mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-27 06:12:19 +00:00
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:
parent
8400961a00
commit
f9e543bed3
1 changed files with 11 additions and 2 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue