demos: remove OSMESA stuff from Makefile
[mesa.git] / progs / demos / texobj.c
index d4173604b7d6886cd490cee2835959086a9a85eb..40bce6e56954375cc2f169e375c98f20f66db4d4 100644 (file)
@@ -1,4 +1,3 @@
-/* $Id: texobj.c,v 1.6 2002/01/04 21:05:57 brianp Exp $ */
 
 /*
  * Example of using the 1.1 texture object functions.
@@ -9,6 +8,7 @@
 
 #include <assert.h>
 #include <math.h>
+#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include "GL/glut.h"
@@ -34,8 +34,6 @@ static GLboolean UseObj = GL_FALSE;
 
 static void draw( void )
 {
-   glDepthFunc(GL_EQUAL);
-   /*   glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );*/
    glClear( GL_COLOR_BUFFER_BIT );
 
    glColor3f( 1.0, 1.0, 1.0 );
@@ -87,7 +85,13 @@ static void draw( void )
 
 static void idle( void )
 {
-   Angle += 2.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;
+   Angle += 120.0*dt;
    glutPostRedisplay();
 }