summaryrefslogtreecommitdiffstats
path: root/progs/demos/ipers.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2005-01-09 17:37:50 +0000
committerBrian Paul <[email protected]>2005-01-09 17:37:50 +0000
commit92eddb0fd404624ca198f19e4088927701eec7f5 (patch)
treedd93d51d271e6bd43d09af9e8b0f3a98a640a8d2 /progs/demos/ipers.c
parent516f9bc6e306fe7820649ead125d557b46ca8419 (diff)
better animate rate (Marcelo Magallon)
Diffstat (limited to 'progs/demos/ipers.c')
-rw-r--r--progs/demos/ipers.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/progs/demos/ipers.c b/progs/demos/ipers.c
index d43c662234e..6e153c04e15 100644
--- a/progs/demos/ipers.c
+++ b/progs/demos/ipers.c
@@ -9,7 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
-#include <time.h>
+#include <string.h>
#if defined (WIN32)|| defined(_WIN32)
#include <windows.h>
@@ -18,7 +18,7 @@
#include <GL/glut.h>
-#include "readtex.c"
+#include "readtex.h"
#ifdef XMESA
#include "GL/xmesa.h"
@@ -543,6 +543,12 @@ draw(void)
static GLfloat alpha = 0.0f;
static GLfloat beta = 0.0f;
static float fr = 0.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;
dojoy();
@@ -586,8 +592,8 @@ draw(void)
drawipers(0, FROM_NONE);
glPopMatrix();
- alpha += 0.5f;
- beta += 0.3f;
+ alpha += 4.f * dt;
+ beta += 2.4f * dt;
glDisable(GL_LIGHTING);
glDisable(GL_LIGHT0);