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/reflect.c | |
parent | 516f9bc6e306fe7820649ead125d557b46ca8419 (diff) |
better animate rate (Marcelo Magallon)
Diffstat (limited to 'progs/demos/reflect.c')
-rw-r--r-- | progs/demos/reflect.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/progs/demos/reflect.c b/progs/demos/reflect.c index 91b2ad9e730..d259d7b7188 100644 --- a/progs/demos/reflect.c +++ b/progs/demos/reflect.c @@ -31,8 +31,8 @@ #include <stdio.h> #include <stdlib.h> #include "GL/glut.h" -#include "../util/showbuffer.c" -#include "../util/readtex.c" +#include "showbuffer.h" +#include "readtex.h" #define DEG2RAD (3.14159/180.0) @@ -318,8 +318,14 @@ static void draw_scene( void ) static void idle( void ) { - spin += 2.0; - yrot += 3.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; + spin += 60.0 * dt; + yrot += 90.0 * dt; glutPostRedisplay(); } |