summaryrefslogtreecommitdiff
path: root/progs/tests
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2007-06-08 13:10:01 -0600
committerBrian <brian.paul@tungstengraphics.com>2007-06-08 13:10:01 -0600
commit39d221ef142d24441e5d741d0902624020deebb8 (patch)
tree6d3ae501a20a4fbb36d6bcb4fb2e551ab94a2738 /progs/tests
parent5e9cff0b97b1301c2b13dbfe2570ddb4551f814f (diff)
fix glReadPixels parameters to handle odd-width windows correctly
Diffstat (limited to 'progs/tests')
-rw-r--r--progs/tests/drawbuffers.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/progs/tests/drawbuffers.c b/progs/tests/drawbuffers.c
index d2e826fadf..5e89569380 100644
--- a/progs/tests/drawbuffers.c
+++ b/progs/tests/drawbuffers.c
@@ -74,8 +74,9 @@ Display(void)
buffer);
/* top half = colorbuffer 1 */
glReadBuffer(GL_COLOR_ATTACHMENT1_EXT);
- glReadPixels(0, Height/2, Width, Height / 2, GL_RGBA, GL_UNSIGNED_BYTE,
- buffer + Width * Height / 2 * 4);
+ glReadPixels(0, Height/2, Width, Height - Height / 2,
+ GL_RGBA, GL_UNSIGNED_BYTE,
+ buffer + Width * (Height / 2) * 4);
/* draw to window */
glUseProgram_func(0);