progs/tests: Make texcompress2 get texture
authorJakob Bornecrantz <jakob@vmware.com>
Wed, 15 Apr 2009 21:36:22 +0000 (23:36 +0200)
committerJakob Bornecrantz <jakob@vmware.com>
Wed, 15 Apr 2009 21:36:22 +0000 (23:36 +0200)
progs/tests/texcompress2.c

index cbb8f1d3a22d53b783dbd264d80483c1b9f88da6..b95aca9fb982f8bbe3eedb0a0926caaee82e3f43 100644 (file)
@@ -51,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);
@@ -82,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)
 {
@@ -146,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();
 
 }