better animate rate (Marcelo Magallon)

This commit is contained in:
Brian Paul
2005-01-09 17:37:50 +00:00
parent 516f9bc6e3
commit 92eddb0fd4
17 changed files with 177 additions and 77 deletions

View File

@@ -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 )