From a58065d4e2fc29644d804c92be773731242664c5 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Tue, 10 Mar 2009 13:11:23 +0000 Subject: progs/tests: compile with SCons and glew Also get mingw cross-compilation of these tests working --- progs/tests/texcompress2.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'progs/tests/texcompress2.c') diff --git a/progs/tests/texcompress2.c b/progs/tests/texcompress2.c index e2eed756b6..3e8e9908cb 100644 --- a/progs/tests/texcompress2.c +++ b/progs/tests/texcompress2.c @@ -3,9 +3,9 @@ */ -#define GL_GLEXT_PROTOTYPES #include #include +#include #include #include #include "readtex.c" @@ -258,6 +258,7 @@ main( int argc, char *argv[] ) glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE); glutCreateWindow(argv[0]); + glewInit(); glutReshapeFunc( Reshape ); glutKeyboardFunc( Key ); -- cgit v1.2.3 From 39320c1bee93e7177a82307d861ed4c1f2cb2711 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Sun, 22 Mar 2009 08:46:18 +0100 Subject: progs/tests: Build texcompress2 with scons --- progs/tests/SConscript | 1 + progs/tests/texcompress2.c | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) (limited to 'progs/tests/texcompress2.c') diff --git a/progs/tests/SConscript b/progs/tests/SConscript index cfeb9d1c37..bf1e7f8a7d 100644 --- a/progs/tests/SConscript +++ b/progs/tests/SConscript @@ -105,6 +105,7 @@ progs = [ 'subtexrate', 'tex1d', 'texcmp', + 'texcompress2', 'texfilt', 'texgenmix', 'texline', diff --git a/progs/tests/texcompress2.c b/progs/tests/texcompress2.c index 3e8e9908cb..cbb8f1d3a2 100644 --- a/progs/tests/texcompress2.c +++ b/progs/tests/texcompress2.c @@ -7,7 +7,6 @@ #include #include #include -#include #include "readtex.c" #define IMAGE_FILE "../images/arch.rgb" -- cgit v1.2.3 From 82e92eeab0c831683961175d155865786149a354 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Wed, 15 Apr 2009 23:36:22 +0200 Subject: progs/tests: Make texcompress2 get texture --- progs/tests/texcompress2.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'progs/tests/texcompress2.c') diff --git a/progs/tests/texcompress2.c b/progs/tests/texcompress2.c index cbb8f1d3a2..b95aca9fb9 100644 --- a/progs/tests/texcompress2.c +++ b/progs/tests/texcompress2.c @@ -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(); } -- cgit v1.2.3