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') diff --git a/progs/tests/texcmp.c b/progs/tests/texcmp.c index d1e829d1b7..743b1b09b4 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 bb659f6e53095d4eeef85a3d586721306a0c3e80 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 1 Oct 2009 16:43:22 -0600 Subject: progs/tests: additional debug code --- progs/tests/packedpixels.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'progs') diff --git a/progs/tests/packedpixels.c b/progs/tests/packedpixels.c index 1703b271cb..f4e5d0a795 100644 --- a/progs/tests/packedpixels.c +++ b/progs/tests/packedpixels.c @@ -191,6 +191,16 @@ MakeTexture(const struct pixel_format *format, GLenum intFormat, GLboolean swap) format->format, format->type, texBuffer); } + if (0) { + GLint r, g, b, a; + 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); + glGetError(); + } + if (glGetError()) { printf("GL Error for %s\n", format->name); memset(texBuffer, 255, 1000); -- cgit v1.2.3 From 82ffc5884c29a8d4eb70fde15f27cace4732a4bb Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 21 Oct 2009 21:51:06 -0600 Subject: progs/tests: draw Z values as luminance, no pixel zoom --- progs/tests/zreaddraw.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'progs') diff --git a/progs/tests/zreaddraw.c b/progs/tests/zreaddraw.c index 7dfed20cfb..7740695bb6 100644 --- a/progs/tests/zreaddraw.c +++ b/progs/tests/zreaddraw.c @@ -58,6 +58,10 @@ static void Display(void) printf("Depth value range: [%f, %f]\n", min, max); } + /* Draw the Z image as luminance above original rendering */ + glWindowPos2i(0, 100); + glDrawPixels(100, 100, GL_LUMINANCE, depthType, depth); + if (TestPacking) { glPixelStorei(GL_PACK_ROW_LENGTH, 0); glPixelStorei(GL_PACK_SKIP_PIXELS, 0); @@ -100,6 +104,7 @@ static void Display(void) glReadPixels(100, 0, 400, 400, GL_DEPTH_COMPONENT, GL_FLOAT, depth2); /* draw as luminance */ glPixelZoom(1.0, 1.0); + glWindowPos2i(100, 0); glDrawPixels(400, 400, GL_LUMINANCE, GL_FLOAT, depth2); glutSwapBuffers(); -- cgit v1.2.3 From 51bc12d62338ad1874c437d692e1182c0bf3d4cd Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 24 Oct 2009 11:08:01 -0600 Subject: progs/tests: fix sub texture offsets --- progs/tests/texcompsub.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'progs') diff --git a/progs/tests/texcompsub.c b/progs/tests/texcompsub.c index 50106bf1e2..215f5711d9 100644 --- a/progs/tests/texcompsub.c +++ b/progs/tests/texcompsub.c @@ -35,6 +35,8 @@ LoadCompressedImage(void) unsigned char ImgDataTemp[ImgSize / 4]; unsigned i; const GLenum filter = GL_LINEAR; + const int half = ImgSize / 2; + glTexImage2D(Target, 0, CompFormat, ImgWidth, ImgHeight, 0, GL_RGB, GL_UNSIGNED_BYTE, NULL); @@ -42,11 +44,11 @@ LoadCompressedImage(void) glCompressedTexSubImage2DARB(Target, 0, 0, 0, /* pos */ ImgWidth, ImgHeight / 2, - CompFormat, ImgSize / 2, ImgData + ImgSize / 2); + CompFormat, ImgSize / 2, ImgData /*+ ImgSize / 2*/); /* top left */ for (i = 0; i < ImgHeight / 8; i++) { - memcpy(&ImgDataTemp[i * ImgWidth], &ImgData[i * 2 * ImgWidth], ImgWidth); + memcpy(&ImgDataTemp[i * ImgWidth], &ImgData[half + i * 2 * ImgWidth], ImgWidth); } glCompressedTexSubImage2DARB(Target, 0, 0, ImgHeight / 2, /* pos */ @@ -55,7 +57,7 @@ LoadCompressedImage(void) /* top right */ for (i = 0; i < ImgHeight / 8; i++) { - memcpy(&ImgDataTemp[i * ImgWidth], &ImgData[i * 2 * ImgWidth + ImgWidth], ImgWidth); + memcpy(&ImgDataTemp[i * ImgWidth], &ImgData[half + i * 2 * ImgWidth + ImgWidth], ImgWidth); } glCompressedTexSubImage2DARB(Target, 0, ImgWidth / 2, ImgHeight / 2, /* pos */ -- 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') diff --git a/progs/tests/texcmp.c b/progs/tests/texcmp.c index 743b1b09b4..ebb537272f 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