From f9e543bed32994ec58de80d62981f2a184c2b476 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 5 Mar 2017 20:51:48 +0200 Subject: [PATCH] Fixed black target screen during wipe (legacy renderer only) Credits: NiTROACTiVE and Erick194 https://www.doomworld.com/vb/source-ports/93179-two-issues-im-having-with-gzdoom-v2-3-2/ --- src/gl/system/gl_wipe.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/gl/system/gl_wipe.cpp b/src/gl/system/gl_wipe.cpp index 51d3f9042..e0d944ad9 100644 --- a/src/gl/system/gl_wipe.cpp +++ b/src/gl/system/gl_wipe.cpp @@ -143,17 +143,26 @@ bool OpenGLFrameBuffer::WipeStartScreen(int type) glFinish(); wipestartscreen->Bind(0, false, false); + const auto copyPixels = [&viewport]() + { + glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, viewport.left, viewport.top, viewport.width, viewport.height); + }; + if (FGLRenderBuffers::IsEnabled()) { GLRenderer->mBuffers->BindCurrentFB(); - glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, viewport.left, viewport.top, viewport.width, viewport.height); + copyPixels(); + } + else if (gl.legacyMode) + { + copyPixels(); } else { GLint readbuffer = 0; glGetIntegerv(GL_READ_BUFFER, &readbuffer); glReadBuffer(GL_FRONT); - glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, viewport.left, viewport.top, viewport.width, viewport.height); + copyPixels(); glReadBuffer(readbuffer); }