Merge pull request #5341 from Cacodemon345/patch-689919

Attempt fixing OpenGL 3.x screenshot
This commit is contained in:
Miran Grča
2025-03-13 23:20:09 +01:00
committed by GitHub

View File

@@ -1667,6 +1667,9 @@ OpenGLRenderer::render()
unsigned char *rgba = (unsigned char *)calloc(1, width * height * 4);
glw.glFinish();
glw.glBindFramebuffer(GL_FRAMEBUFFER, 0);
glw.glReadBuffer(GL_BACK);
glw.glFinish();
glw.glReadPixels(window_rect.x, window_rect.y, width, height, GL_RGBA, GL_UNSIGNED_BYTE, rgba);