progs/tests: print usage info upon SPACE/u
authorBrian Paul <brianp@vmware.com>
Fri, 25 Sep 2009 22:38:14 +0000 (16:38 -0600)
committerBrian Paul <brianp@vmware.com>
Mon, 28 Sep 2009 14:44:43 +0000 (08:44 -0600)
progs/tests/mipmap_limits.c

index b8e52dd..9418e90 100644 (file)
@@ -250,6 +250,21 @@ myReshape(int w, int h)
    glLoadIdentity();
 }
 
+
+static void
+usage(void)
+{
+   printf("usage:\n");
+   printf("  b/B    decrease/increase GL_TEXTURE_BASE_LEVEL\n");
+   printf("  m/M    decrease/increase GL_TEXTURE_MAX_LEVEL\n");
+   printf("  n/N    decrease/increase GL_TEXTURE_MIN_LOD\n");
+   printf("  x/X    decrease/increase GL_TEXTURE_MAX_LOD\n");
+   printf("  l/L    decrease/increase GL_TEXTURE_LOD_BIAS\n");
+   printf("  f      toggle nearest/linear filtering\n");
+   printf("  t      toggle texture color/image\n");
+   printf("  SPACE  reset values\n");
+}
+
 static void
 key(unsigned char k, int x, int y)
 {
@@ -305,6 +320,9 @@ key(unsigned char k, int x, int y)
       break;
    case ' ':
       InitValues();
+      /* fall-through */
+   case 'u':
+      usage();
       break;
    case 27:                    /* Escape */
       exit(0);
@@ -316,21 +334,6 @@ key(unsigned char k, int x, int y)
 }
 
 
-static void
-usage(void)
-{
-   printf("usage:\n");
-   printf("  b/B    decrease/increase GL_TEXTURE_BASE_LEVEL\n");
-   printf("  m/M    decrease/increase GL_TEXTURE_MAX_LEVEL\n");
-   printf("  n/N    decrease/increase GL_TEXTURE_MIN_LOD\n");
-   printf("  x/X    decrease/increase GL_TEXTURE_MAX_LOD\n");
-   printf("  l/L    decrease/increase GL_TEXTURE_LOD_BIAS\n");
-   printf("  f      toggle nearest/linear filtering\n");
-   printf("  t      toggle texture color/image\n");
-   printf("  SPACE  reset values\n");
-}
-
-
 int
 main(int argc, char **argv)
 {