mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-08 10:40:11 +01:00
fix glReadPixels parameters to handle odd-width windows correctly
This commit is contained in:
parent
5e9cff0b97
commit
39d221ef14
1 changed files with 3 additions and 2 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue