st/xorg: Work around cursor reference counting bugs in older X servers.
[mesa.git] / progs / tests / fbotest2.c
index c3117b0f76768d03034ea3d32e6f80b129339344..f9c506193f64196e27c5fd391b10905fd43f2939 100644 (file)
@@ -6,13 +6,14 @@
  */
 
 
-#define GL_GLEXT_PROTOTYPES
 #include <assert.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <math.h>
+#include <GL/glew.h>
 #include <GL/glut.h>
 
+static int Win = 0;
 static int Width = 400, Height = 400;
 static GLuint MyFB, ColorRb, DepthRb;
 static GLboolean Animate = GL_TRUE;
@@ -67,6 +68,7 @@ Display( void )
 
    /* draw to window */
    glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
+   glDisable(GL_DEPTH_TEST);  /* in case window has depth buffer */
    glWindowPos2iARB(0, 0);
    glDrawPixels(Width, Height, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
 
@@ -110,6 +112,7 @@ CleanUp(void)
    assert(!glIsFramebufferEXT(MyFB));
    assert(!glIsRenderbufferEXT(ColorRb));
    assert(!glIsRenderbufferEXT(DepthRb));
+   glutDestroyWindow(Win);
    exit(0);
 }
 
@@ -187,7 +190,8 @@ main( int argc, char *argv[] )
    glutInitWindowPosition( 0, 0 );
    glutInitWindowSize(Width, Height);
    glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE );
-   glutCreateWindow(argv[0]);
+   Win = glutCreateWindow(argv[0]);
+   glewInit();
    glutReshapeFunc( Reshape );
    glutKeyboardFunc( Key );
    glutDisplayFunc( Display );