commit | 92eddb0fd404624ca198f19e4088927701eec7f5 | [log] [tgz] |
---|---|---|
author | Brian Paul <brian.paul@tungstengraphics.com> | Sun Jan 09 17:37:50 2005 +0000 |
committer | Brian Paul <brian.paul@tungstengraphics.com> | Sun Jan 09 17:37:50 2005 +0000 |
tree | dd93d51d271e6bd43d09af9e8b0f3a98a640a8d2 | |
parent | 516f9bc6e306fe7820649ead125d557b46ca8419 [diff] [blame] |
better animate rate (Marcelo Magallon)
diff --git a/progs/demos/renormal.c b/progs/demos/renormal.c index 4fc1957..9e5da95 100644 --- a/progs/demos/renormal.c +++ b/progs/demos/renormal.c
@@ -13,9 +13,15 @@ static GLfloat Phi = 0.0; -static void Idle(void) +static void Idle( void ) { - Phi += 0.1; + static double t0 = -1.; + double dt, t = glutGet(GLUT_ELAPSED_TIME) / 1000.0; + if (t0 < 0.0) + t0 = t; + dt = t - t0; + t0 = t; + Phi += 3.0 * dt; glutPostRedisplay(); }