progs/trivial: Redraw upon keypress.
[mesa.git] / progs / trivial / tri-query.c
index 25cfcb8e148f5fbe74f14873c2ef47a2c6ccc2a2..8898f182c78d623bdccdaf46a4d1baaa2285ed22 100644 (file)
@@ -39,9 +39,15 @@ GLenum doubleBuffer;
 
 static void Init(void)
 {
+   if (!glutExtensionSupported("GL_ARB_occlusion_query")) {
+      fprintf(stderr, "Sorry, this program requires GL_ARB_occlusion_query\n");
+      exit(1);
+   }
+
    fprintf(stderr, "GL_RENDERER   = %s\n", (char *) glGetString(GL_RENDERER));
    fprintf(stderr, "GL_VERSION    = %s\n", (char *) glGetString(GL_VERSION));
    fprintf(stderr, "GL_VENDOR     = %s\n", (char *) glGetString(GL_VENDOR));
+   fflush(stderr);
 
     glClearColor(0.0, 0.0, 1.0, 0.0);
 
@@ -66,7 +72,7 @@ static void Key(unsigned char key, int x, int y)
       case 27:
        exit(1);
       default:
-       return;
+       break;
     }
 
     glutPostRedisplay();
@@ -144,7 +150,7 @@ int main(int argc, char **argv)
     type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
     glutInitDisplayMode(type);
 
-    if (glutCreateWindow("First Tri") == GL_FALSE) {
+    if (glutCreateWindow(*argv) == GL_FALSE) {
        exit(1);
     }