Fix Nvidia driver ignoring wglSwapIntervalEXT

This commit is contained in:
Magnus Norddahl 2016-08-08 01:11:43 +02:00 committed by Christoph Oelckers
parent 9ab9548723
commit 2ac91f0c5a
2 changed files with 5 additions and 2 deletions

View File

@ -94,6 +94,10 @@ CUSTOM_CVAR(Int, vid_hwgamma, 2, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITC
OpenGLFrameBuffer::OpenGLFrameBuffer(void *hMonitor, int width, int height, int bits, int refreshHz, bool fullscreen) :
Super(hMonitor, width, height, bits, refreshHz, fullscreen)
{
// SetVSync needs to be at the very top to workaround a bug in Nvidia's OpenGL driver.
// If wglSwapIntervalEXT is called after glBindFramebuffer in a frame the setting is not changed!
SetVSync(vid_vsync);
GLRenderer = new FGLRenderer(this);
memcpy (SourcePalette, GPalette.BaseColors, sizeof(PalEntry)*256);
UpdatePalette ();
@ -107,7 +111,6 @@ OpenGLFrameBuffer::OpenGLFrameBuffer(void *hMonitor, int width, int height, int
needsetgamma = true;
swapped = false;
Accel2D = true;
SetVSync(vid_vsync);
}
OpenGLFrameBuffer::~OpenGLFrameBuffer()

View File

@ -1141,7 +1141,7 @@ void Win32GLFrameBuffer::ReleaseResources ()
void Win32GLFrameBuffer::SetVSync (bool vsync)
{
if (vsyncfunc != NULL) vsyncfunc(vsync);
if (vsyncfunc != NULL) vsyncfunc(vsync ? 1 : 0);
}
void Win32GLFrameBuffer::SwapBuffers()