From c166abbbc1242184dc0113b4e1a15ce93c7658f2 Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Fri, 14 Mar 2025 14:07:33 +0600 Subject: [PATCH] Always use an alpha value of 1.0 for drawing scene to texture Fixes invisible screenshots and blank screens on certain systems --- src/qt/qt_openglrenderer.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/qt/qt_openglrenderer.cpp b/src/qt/qt_openglrenderer.cpp index 88fefa0c3..3b2ec58e0 100644 --- a/src/qt/qt_openglrenderer.cpp +++ b/src/qt/qt_openglrenderer.cpp @@ -107,6 +107,7 @@ const char* fragment_shader_default_tex_src = "void main()\n" "{\n" " color = texture(Texture, texCoord);\n" + " color.a = 1.0;\n" "}\n"; const char* vertex_shader_default_color_src = @@ -141,6 +142,7 @@ const char* fragment_shader_default_color_src = "void main()\n" "{\n" " outColor = color;\n" + " outColor.a = 1.0;\n" "}\n"; static inline int @@ -1667,9 +1669,6 @@ 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);