summaryrefslogtreecommitdiff
path: root/progs
diff options
context:
space:
mode:
Diffstat (limited to 'progs')
-rw-r--r--progs/tests/packedpixels.c10
-rw-r--r--progs/tests/texcmp.c5
-rw-r--r--progs/tests/texcompsub.c8
-rw-r--r--progs/tests/zreaddraw.c5
4 files changed, 25 insertions, 3 deletions
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);
diff --git a/progs/tests/texcmp.c b/progs/tests/texcmp.c
index 45935e19a3..3f2cee6e46 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);
@@ -115,7 +117,10 @@ static void Display( void )
glPopMatrix();
+ glDisable(GL_TEXTURE_2D);
+
/* info */
+ glDisable(GL_BLEND);
glColor4f(1, 1, 1, 1);
glRasterPos3f(-1.2, -0.7, 0);
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 */
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();