summaryrefslogtreecommitdiff
path: root/progs/tests
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-11-03 09:54:09 -0700
committerBrian Paul <brianp@vmware.com>2009-11-03 09:54:09 -0700
commit4bced42341d13303ae023957d3001a640cf7ea2d (patch)
tree2bbfe5c00a876ea5342ec81713b2ff6006adccd8 /progs/tests
parent800e553e7a1703e33e54f45d0638b67001665fc5 (diff)
parenta0cd2b7029e1ac6699b807baa255e7fd2abe7f54 (diff)
Merge branch 'mesa_7_6_branch'
Diffstat (limited to 'progs/tests')
-rw-r--r--progs/tests/drawbuffers.c17
-rw-r--r--progs/tests/mipmap_comp.c6
2 files changed, 18 insertions, 5 deletions
diff --git a/progs/tests/drawbuffers.c b/progs/tests/drawbuffers.c
index d75a870c26..7a19933e62 100644
--- a/progs/tests/drawbuffers.c
+++ b/progs/tests/drawbuffers.c
@@ -43,6 +43,8 @@ Display(void)
glUseProgram_func(Program);
+ glEnable(GL_DEPTH_TEST);
+
/* draw to user framebuffer */
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, FBobject);
@@ -68,18 +70,23 @@ Display(void)
glPopMatrix();
/* read from user framebuffer */
- /* bottom half = colorbuffer 0 */
+ /* left half = colorbuffer 0 */
glReadBuffer(GL_COLOR_ATTACHMENT0_EXT);
- glReadPixels(0, 0, Width, Height / 2, GL_RGBA, GL_UNSIGNED_BYTE,
+ glPixelStorei(GL_PACK_ROW_LENGTH, Width);
+ glPixelStorei(GL_PACK_SKIP_PIXELS, 0);
+ glReadPixels(0, 0, Width / 2, Height, GL_RGBA, GL_UNSIGNED_BYTE,
buffer);
- /* top half = colorbuffer 1 */
+
+ /* right half = colorbuffer 1 */
glReadBuffer(GL_COLOR_ATTACHMENT1_EXT);
- glReadPixels(0, Height/2, Width, Height - Height / 2,
+ glPixelStorei(GL_PACK_SKIP_PIXELS, Width / 2);
+ glReadPixels(Width / 2, 0, Width - Width / 2, Height,
GL_RGBA, GL_UNSIGNED_BYTE,
- buffer + Width * (Height / 2) * 4);
+ buffer);
/* draw to window */
glUseProgram_func(0);
+ glDisable(GL_DEPTH_TEST);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
glWindowPos2iARB(0, 0);
glDrawPixels(Width, Height, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
diff --git a/progs/tests/mipmap_comp.c b/progs/tests/mipmap_comp.c
index 5842e2b880..dd2232113b 100644
--- a/progs/tests/mipmap_comp.c
+++ b/progs/tests/mipmap_comp.c
@@ -285,6 +285,12 @@ main(int argc, char** argv)
glutInitWindowSize (600, 600);
glutCreateWindow (argv[0]);
glewInit();
+
+ if (!glutExtensionSupported("GL_EXT_texture_compression_s3tc")) {
+ fprintf(stderr, "This test requires GL_EXT_texture_compression_s3tc.\n");
+ exit(1);
+ }
+
myInit();
glutReshapeFunc (myReshape);
glutDisplayFunc(display);