better animate rate (Marcelo Magallon)
This commit is contained in:
@@ -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 )
|
||||
|
Reference in New Issue
Block a user