summaryrefslogtreecommitdiff
path: root/progs/demos/morph3d.c
diff options
context:
space:
mode:
Diffstat (limited to 'progs/demos/morph3d.c')
-rw-r--r--progs/demos/morph3d.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/progs/demos/morph3d.c b/progs/demos/morph3d.c
index 2ce04a3099..047d571c70 100644
--- a/progs/demos/morph3d.c
+++ b/progs/demos/morph3d.c
@@ -660,6 +660,13 @@ static void draw_ico( void )
}
static void draw ( void ) {
+ static double t0 = -1.;
+ double dt, t = glutGet(GLUT_ELAPSED_TIME) / 1000.0;
+ if (t0 < 0.0)
+ t0 = t;
+ dt = t - t0;
+ t0 = t;
+
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
glPushMatrix();
@@ -681,7 +688,7 @@ static void draw ( void ) {
glutSwapBuffers();
- step+=0.05;
+ step += dt;
}
static void idle_( void )