X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=progs%2Fsamples%2Fsphere.c;h=7d0508dee9f1934e44b4aa20fc1a47ef3b1872aa;hb=9f8cfa75ca0882a8015a714887b41f8a7a10fd19;hp=1f326db04d608228f06f2222ad285d296d9fa209;hpb=efeddebe814c04d2c7f43f66bb9a77a4388fa842;p=mesa.git diff --git a/progs/samples/sphere.c b/progs/samples/sphere.c index 1f326db04d6..7d0508dee9f 100644 --- a/progs/samples/sphere.c +++ b/progs/samples/sphere.c @@ -29,7 +29,7 @@ #include #include #include -#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':