From 92eddb0fd404624ca198f19e4088927701eec7f5 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 9 Jan 2005 17:37:50 +0000 Subject: better animate rate (Marcelo Magallon) --- progs/demos/shadowtex.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'progs/demos/shadowtex.c') diff --git a/progs/demos/shadowtex.c b/progs/demos/shadowtex.c index 18aad47ed5..e918751a7a 100644 --- a/progs/demos/shadowtex.c +++ b/progs/demos/shadowtex.c @@ -33,7 +33,7 @@ #include #include #include -#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(); } -- cgit v1.2.3