added z/s keys to reset/step rotation
authorBrian <brian.paul@tungstengraphics.com>
Fri, 16 Nov 2007 22:18:30 +0000 (15:18 -0700)
committerBrian <brian.paul@tungstengraphics.com>
Fri, 16 Nov 2007 22:19:05 +0000 (15:19 -0700)
progs/glsl/trirast.c

index e4325deb1f3f6dbbe00d34fde76c5d2b32cc7fad..2842755447e5da00a4665eea84260c516261f8f7 100644 (file)
@@ -106,8 +106,12 @@ Redisplay(void)
 static void
 Idle(void)
 {
-   Zrot = glutGet(GLUT_ELAPSED_TIME) * 0.0005;
-   glutPostRedisplay();
+   if (anim) {
+      Zrot = glutGet(GLUT_ELAPSED_TIME) * 0.0005;
+      glutPostRedisplay();
+   }
+   else
+      abort();
 }
 
 
@@ -149,6 +153,12 @@ Key(unsigned char key, int x, int y)
       else
          glutIdleFunc(NULL);
       break;
+   case 'z':
+      Zrot = 0;
+      break;
+   case 's':
+      Zrot += 0.05;
+      break;
    case 27:
       CleanUp();
       exit(0);