From 6c6896bd25034fb4c457110f45fe73277a9ce463 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 27 Sep 2009 18:02:02 -0600 Subject: progs/tests: disable texturing before printing text --- progs/tests/texcmp.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'progs/tests/texcmp.c') diff --git a/progs/tests/texcmp.c b/progs/tests/texcmp.c index d1e829d1b73..743b1b09b44 100644 --- a/progs/tests/texcmp.c +++ b/progs/tests/texcmp.c @@ -115,6 +115,8 @@ static void Display( void ) glPopMatrix(); + glDisable(GL_TEXTURE_2D); + /* info */ glColor4f(1, 1, 1, 1); -- cgit v1.2.3 From b01937a3c967ed23315c7543f97228be06942b7d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 23 Oct 2009 14:52:10 -0600 Subject: progs/tests: print requested/internal format info --- progs/tests/texcmp.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'progs/tests/texcmp.c') diff --git a/progs/tests/texcmp.c b/progs/tests/texcmp.c index d1e829d1b73..45935e19a35 100644 --- a/progs/tests/texcmp.c +++ b/progs/tests/texcmp.c @@ -149,7 +149,7 @@ static void Reshape( int width, int height ) static void ReInit( GLenum TC, TEXTURE *Tx ) { - GLint rv; + GLint rv, v; if ((Tx->TC == TC) && (Tx->cData != NULL)) { glCompressedTexImage2DARB(GL_TEXTURE_2D, /* target */ @@ -170,6 +170,12 @@ static void ReInit( GLenum TC, TEXTURE *Tx ) GL_UNSIGNED_BYTE, /* texture type */ Tx->data); /* the texture */ + + v = 0; + glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, + GL_TEXTURE_INTERNAL_FORMAT, &v); + printf("Requested internal format = 0x%x, actual = 0x%x\n", TC, v); + /* okay, now cache the compressed texture */ Tx->TC = TC; if (Tx->cData != NULL) { -- cgit v1.2.3 From d8ded352ec45696e88efe6d52a375bbf541354e9 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 25 Oct 2009 18:10:45 -0600 Subject: progs/tests: disable blending while drawing text --- progs/tests/texcmp.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'progs/tests/texcmp.c') diff --git a/progs/tests/texcmp.c b/progs/tests/texcmp.c index 743b1b09b44..ebb537272f6 100644 --- a/progs/tests/texcmp.c +++ b/progs/tests/texcmp.c @@ -106,6 +106,8 @@ static void Display( void ) glRotatef(Rot, 0, 0, 1); glEnable(GL_TEXTURE_2D); + glEnable(GL_BLEND); + glBegin(GL_POLYGON); glTexCoord2f(0, 1); glVertex2f(-1, -0.5); glTexCoord2f(1, 1); glVertex2f( 1, -0.5); @@ -118,6 +120,7 @@ static void Display( void ) glDisable(GL_TEXTURE_2D); /* info */ + glDisable(GL_BLEND); glColor4f(1, 1, 1, 1); glRasterPos3f(-1.2, -0.7, 0); -- cgit v1.2.3 From a017ad2861e8df0cfea7808cf9c094b9c4bcac48 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 3 Nov 2009 10:01:10 -0700 Subject: progs/tests: debug code for getting texture component sizes --- progs/tests/packedpixels.c | 7 +++++-- progs/tests/texcmp.c | 12 ++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) (limited to 'progs/tests/texcmp.c') diff --git a/progs/tests/packedpixels.c b/progs/tests/packedpixels.c index f4e5d0a7953..d318cf516aa 100644 --- a/progs/tests/packedpixels.c +++ b/progs/tests/packedpixels.c @@ -192,12 +192,15 @@ MakeTexture(const struct pixel_format *format, GLenum intFormat, GLboolean swap) } if (0) { - GLint r, g, b, a; + GLint r, g, b, a, l, i; glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_RED_SIZE, &r); glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_GREEN_SIZE, &g); glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_BLUE_SIZE, &b); glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_ALPHA_SIZE, &a); - printf("sizes: %d %d %d %d\n", r, g, b, a); + glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_LUMINANCE_SIZE, &l); + glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_INTENSITY_SIZE, &i); + printf("IntFormat: 0x%x R %d G %d B %d A %d L %d I %d\n", + intFormat, r, g, b, a, l, i); glGetError(); } diff --git a/progs/tests/texcmp.c b/progs/tests/texcmp.c index 3f2cee6e46d..c5d352fdaed 100644 --- a/progs/tests/texcmp.c +++ b/progs/tests/texcmp.c @@ -181,6 +181,18 @@ static void ReInit( GLenum TC, TEXTURE *Tx ) GL_TEXTURE_INTERNAL_FORMAT, &v); printf("Requested internal format = 0x%x, actual = 0x%x\n", TC, v); + if (0) { + GLint r, g, b, a, l, i; + glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_RED_SIZE, &r); + glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_GREEN_SIZE, &g); + glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_BLUE_SIZE, &b); + glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_ALPHA_SIZE, &a); + glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_LUMINANCE_SIZE, &l); + glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_INTENSITY_SIZE, &i); + printf("Compressed Bits per R: %d G: %d B: %d A: %d L: %d I: %d\n", + r, g, b, a, l, i); + } + /* okay, now cache the compressed texture */ Tx->TC = TC; if (Tx->cData != NULL) { -- cgit v1.2.3