progs/tests: also test stencil INCR_WRAP mode if supported
[mesa.git] / progs / tests / texcompress2.c
index e2eed756b627e6932572ee80fd1bcab8b6492a99..b95aca9fb982f8bbe3eedb0a0926caaee82e3f43 100644 (file)
@@ -3,11 +3,10 @@
  */
 
 
-#define GL_GLEXT_PROTOTYPES
 #include <assert.h>
 #include <stdio.h>
+#include <GL/glew.h>
 #include <GL/glut.h>
-#include <GL/glx.h>
 #include "readtex.c"
 
 #define IMAGE_FILE "../images/arch.rgb"
@@ -52,7 +51,6 @@ TestSubTex(void)
    GLboolean all = 0*GL_TRUE;
    GLubyte *buffer;
    GLint size, fmt;
-   int i;
 
    glGetTexLevelParameteriv(Target, 0,
                             GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB, &size);
@@ -83,6 +81,23 @@ TestSubTex(void)
 }
 
 
+static void
+TestGetTex(void)
+{
+   GLubyte *buffer;
+
+   buffer = (GLubyte *) malloc(3 * ImgWidth * ImgHeight);
+
+   glGetTexImage(GL_TEXTURE_2D,
+                 0,
+                 GL_RGB,
+                 GL_UNSIGNED_BYTE,
+                 buffer);
+
+   free(buffer);
+}
+
+
 static void
 LoadCompressedImage(const char *file)
 {
@@ -147,7 +162,10 @@ LoadCompressedImage(const char *file)
    glTexParameteri(Target, GL_TEXTURE_MIN_FILTER, filter);
    glTexParameteri(Target, GL_TEXTURE_MAG_FILTER, filter);
 
-   TestSubTex();
+   if (0)
+      TestSubTex();
+   else
+      TestGetTex();
 
 }
 
@@ -258,6 +276,7 @@ main( int argc, char *argv[] )
    glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE);
 
    glutCreateWindow(argv[0]);
+   glewInit();
 
    glutReshapeFunc( Reshape );
    glutKeyboardFunc( Key );