llvmpipe: still more bin code reorganization
[mesa.git] / progs / trivial / quad-tex-2d.c
index 3a6e5237ed50fc4251550cf474b80081a9653890..8a886ef578c9c4db15ffdcd93cd83970f0f60448 100644 (file)
@@ -31,12 +31,14 @@ static GLenum Target = GL_TEXTURE_2D;
 static GLenum Filter = GL_NEAREST;
 GLenum doubleBuffer;
 static float Rot = 0;
+static int win = 0;
 
 static void Init(void)
 {
    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);
 
@@ -88,6 +90,7 @@ static void Reshape(int width, int height)
    glFrustum(-1, 1, -1, 1, 10, 20);
 #endif
    glMatrixMode(GL_MODELVIEW);
+   glLoadIdentity();
    glTranslatef(0, 0, -15);
 }
 
@@ -101,6 +104,7 @@ static void Key(unsigned char key, int x, int y)
       Rot -= 10.0;
       break;
    case 27:
+      glutDestroyWindow(win);
       exit(0);
    default:
       return;
@@ -170,7 +174,8 @@ int main(int argc, char **argv)
     type |= (doubleBuffer) ? GLUT_DOUBLE : GLUT_SINGLE;
     glutInitDisplayMode(type);
 
-    if (glutCreateWindow("First Tri") == GL_FALSE) {
+    win = glutCreateWindow(*argv);
+    if (!win) {
        exit(1);
     }