diff options
Diffstat (limited to 'progs/tests/texcompress2.c')
-rw-r--r-- | progs/tests/texcompress2.c | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/progs/tests/texcompress2.c b/progs/tests/texcompress2.c index e2eed756b6..b95aca9fb9 100644 --- a/progs/tests/texcompress2.c +++ b/progs/tests/texcompress2.c @@ -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); @@ -84,6 +82,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) { const GLenum filter = GL_LINEAR; @@ -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 ); |