fix softpipe_clear() to handle ps->offset!=0 (such as when rendering to texture and...
[mesa.git] / progs / samples / sphere.c
index 1f326db04d608228f06f2222ad285d296d9fa209..7d0508dee9f1934e44b4aa20fc1a47ef3b1872aa 100644 (file)
@@ -29,7 +29,7 @@
 #include <math.h>
 #include <stdlib.h>
 #include <GL/glut.h>
-#include "../util/readtex.c"
+#include "readtex.h"
 
 
 #ifndef PI
@@ -692,7 +692,7 @@ void Init(void)
     float lmodel_twoside[] = {GL_TRUE};
     int w, h;
     GLenum format;
-    char *image;
+    GLubyte *image;
 
     printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER));
 
@@ -820,8 +820,16 @@ void Reshape(int width, int height)
 
 void Idle(void)
 {
-   xRotation += .75;
-   yRotation += .375;
+   static double t0 = -1.;
+   double t, dt;
+   t = glutGet(GLUT_ELAPSED_TIME) / 1000.;
+   if (t0 < 0.)
+      t0 = t;
+   dt = t - t0;
+   t0 = t;
+
+   xRotation += .75*60.*dt;
+   yRotation += .375*60.*dt;
    glutPostRedisplay();
 }
 
@@ -894,7 +902,6 @@ void Key(unsigned char key, int x, int y)
        break;
       case 'l':
        isLit = !isLit;
-        printf("lit %d\n", isLit);
        ReInit();
        break;
       case 'f':