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/
This commit is contained in:
alexey.lysiuk 2017-03-05 20:51:48 +02:00
parent 8400961a00
commit f9e543bed3

View file

@ -143,17 +143,26 @@ bool OpenGLFrameBuffer::WipeStartScreen(int type)
glFinish(); glFinish();
wipestartscreen->Bind(0, false, false); 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()) if (FGLRenderBuffers::IsEnabled())
{ {
GLRenderer->mBuffers->BindCurrentFB(); 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 else
{ {
GLint readbuffer = 0; GLint readbuffer = 0;
glGetIntegerv(GL_READ_BUFFER, &readbuffer); glGetIntegerv(GL_READ_BUFFER, &readbuffer);
glReadBuffer(GL_FRONT); glReadBuffer(GL_FRONT);
glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, viewport.left, viewport.top, viewport.width, viewport.height); copyPixels();
glReadBuffer(readbuffer); glReadBuffer(readbuffer);
} }