File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -337,10 +337,21 @@ SCP_string gr_opengl_blob_screen()
337337 GLuint pbo = 0 ;
338338
339339 GL_state.PushFramebufferState ();
340- GL_state.BindFrameBuffer (Cmdline_window_res ? Back_framebuffer : 0 , GL_FRAMEBUFFER );
340+
341+ GLuint source_fbo = 0 ;
342+
343+ GLuint render_target = opengl_get_rtt_framebuffer ();
344+ if (render_target != 0 ) {
345+ source_fbo = render_target;
346+ }
347+ else if (Cmdline_window_res) {
348+ source_fbo = Back_framebuffer;
349+ }
350+
351+ GL_state.BindFrameBuffer (source_fbo, GL_FRAMEBUFFER );
341352
342353 // Reading from the front buffer here seems to no longer work correctly; that just reads back all zeros
343- glReadBuffer (Cmdline_window_res ? GL_COLOR_ATTACHMENT0 : GL_FRONT );
354+ glReadBuffer (source_fbo != 0 ? GL_COLOR_ATTACHMENT0 : GL_FRONT );
344355
345356 // now for the data
346357 if (Use_PBOs) {
You can’t perform that action at this time.
0 commit comments