From f94c856fa7e0baeadd8c21e16ac4643c4e4f7639 Mon Sep 17 00:00:00 2001 From: bones_was_here Date: Fri, 6 Sep 2024 04:47:46 +1000 Subject: [PATCH] GL: Use the render path switch properly in GL_ReadPixelsBGRA() This will be needed for screenshots to work with GLES when standard builds support both GLES and GL. Signed-off-by: bones_was_here --- gl_backend.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/gl_backend.c b/gl_backend.c index ba2adf73..02f7bc29 100644 --- a/gl_backend.c +++ b/gl_backend.c @@ -1522,9 +1522,11 @@ void GL_ReadPixelsBGRA(int x, int y, int width, int height, unsigned char *outpi switch(vid.renderpath) { case RENDERPATH_GL32: - case RENDERPATH_GLES2: CHECKGLERROR -#ifndef GL_BGRA + qglReadPixels(x, y, width, height, GL_BGRA, GL_UNSIGNED_BYTE, outpixels);CHECKGLERROR + break; + case RENDERPATH_GLES2: // glReadPixels() lacks GL_BGRA support (even in ES 3.2) + CHECKGLERROR { int i; int r; @@ -1544,10 +1546,7 @@ void GL_ReadPixelsBGRA(int x, int y, int width, int height, unsigned char *outpi // outpixels[i+3] = a; } } -#else - qglReadPixels(x, y, width, height, GL_BGRA, GL_UNSIGNED_BYTE, outpixels);CHECKGLERROR -#endif - break; + break; } } -- 2.39.2