From 1f64d7ee2281d02dfb9ae19064f8bc4aeb367b76 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Tue, 15 Mar 2016 11:30:34 +0200 Subject: [PATCH] Fixed wrong starting frame for wipe animation Menu graphics appeared in starting frame with hardware renderer only Software renderer was not affected as it reads pixels from front buffer instead of back buffer like OpenGL counterpart did See http://forum.drdteam.org/viewtopic.php?t=6857 --- src/gl/system/gl_wipe.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gl/system/gl_wipe.cpp b/src/gl/system/gl_wipe.cpp index 30a996816..232be87a1 100644 --- a/src/gl/system/gl_wipe.cpp +++ b/src/gl/system/gl_wipe.cpp @@ -153,7 +153,11 @@ bool OpenGLFrameBuffer::WipeStartScreen(int type) GLRenderer->mSamplerManager->Bind(1, CLAMP_NONE); glFinish(); wipestartscreen->Bind(0, false, false); + GLint readbuffer = 0; + glGetIntegerv(GL_READ_BUFFER, &readbuffer); + glReadBuffer(GL_FRONT); glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, Width, Height); + glReadBuffer(readbuffer); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);