diff options
author | Brian Paul <[email protected]> | 2005-01-09 17:37:50 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2005-01-09 17:37:50 +0000 |
commit | 92eddb0fd404624ca198f19e4088927701eec7f5 (patch) | |
tree | dd93d51d271e6bd43d09af9e8b0f3a98a640a8d2 /progs/demos/texobj.c | |
parent | 516f9bc6e306fe7820649ead125d557b46ca8419 (diff) |
better animate rate (Marcelo Magallon)
Diffstat (limited to 'progs/demos/texobj.c')
-rw-r--r-- | progs/demos/texobj.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/progs/demos/texobj.c b/progs/demos/texobj.c index f30ede464c0..40bce6e5695 100644 --- a/progs/demos/texobj.c +++ b/progs/demos/texobj.c @@ -85,7 +85,13 @@ static void draw( void ) static void idle( void ) { - Angle += 2.0; + static double t0 = -1.; + double dt, t = glutGet(GLUT_ELAPSED_TIME) / 1000.0; + if (t0 < 0.0) + t0 = t; + dt = t - t0; + t0 = t; + Angle += 120.0*dt; glutPostRedisplay(); } |