mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-27 22:33:17 +00:00
Fix Nvidia driver ignoring wglSwapIntervalEXT
This commit is contained in:
parent
9ab9548723
commit
2ac91f0c5a
2 changed files with 5 additions and 2 deletions
|
@ -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) :
|
OpenGLFrameBuffer::OpenGLFrameBuffer(void *hMonitor, int width, int height, int bits, int refreshHz, bool fullscreen) :
|
||||||
Super(hMonitor, width, height, bits, refreshHz, 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);
|
GLRenderer = new FGLRenderer(this);
|
||||||
memcpy (SourcePalette, GPalette.BaseColors, sizeof(PalEntry)*256);
|
memcpy (SourcePalette, GPalette.BaseColors, sizeof(PalEntry)*256);
|
||||||
UpdatePalette ();
|
UpdatePalette ();
|
||||||
|
@ -107,7 +111,6 @@ OpenGLFrameBuffer::OpenGLFrameBuffer(void *hMonitor, int width, int height, int
|
||||||
needsetgamma = true;
|
needsetgamma = true;
|
||||||
swapped = false;
|
swapped = false;
|
||||||
Accel2D = true;
|
Accel2D = true;
|
||||||
SetVSync(vid_vsync);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
OpenGLFrameBuffer::~OpenGLFrameBuffer()
|
OpenGLFrameBuffer::~OpenGLFrameBuffer()
|
||||||
|
|
|
@ -1141,7 +1141,7 @@ void Win32GLFrameBuffer::ReleaseResources ()
|
||||||
|
|
||||||
void Win32GLFrameBuffer::SetVSync (bool vsync)
|
void Win32GLFrameBuffer::SetVSync (bool vsync)
|
||||||
{
|
{
|
||||||
if (vsyncfunc != NULL) vsyncfunc(vsync);
|
if (vsyncfunc != NULL) vsyncfunc(vsync ? 1 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Win32GLFrameBuffer::SwapBuffers()
|
void Win32GLFrameBuffer::SwapBuffers()
|
||||||
|
|
Loading…
Reference in a new issue