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/shadowtex.c | |
parent | 516f9bc6e306fe7820649ead125d557b46ca8419 (diff) |
better animate rate (Marcelo Magallon)
Diffstat (limited to 'progs/demos/shadowtex.c')
-rw-r--r-- | progs/demos/shadowtex.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/progs/demos/shadowtex.c b/progs/demos/shadowtex.c index 18aad47ed53..e918751a7ad 100644 --- a/progs/demos/shadowtex.c +++ b/progs/demos/shadowtex.c @@ -33,7 +33,7 @@ #include <stdlib.h> #include <math.h> #include <GL/glut.h> -#include "../util/showbuffer.c" +#include "showbuffer.h" #if 0 /* change to 1 if you want to use the old SGIX extensions */ #undef GL_ARB_depth_texture @@ -386,7 +386,13 @@ Reshape(int width, int height) static void Idle(void) { - Yrot += 5.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; + Yrot += 75.0 * dt; /*LightLongitude -= 5.0;*/ glutPostRedisplay(); } |