OpenGL vsync fixes.

This commit is contained in:
rextimmy 2016-12-23 13:59:55 +10:00
parent 38bf2b8175
commit 415f4a046e
7 changed files with 47 additions and 4 deletions

View file

@ -6,6 +6,8 @@
#include "gfx/gl/tGL/tWGL.h"
#endif
#include "gfx/gl/gfxGLUtils.h"
namespace PlatformGL
{
@ -69,6 +71,9 @@ namespace PlatformGL
void setVSync(const int i)
{
PRESERVE_FRAMEBUFFER();
// Nvidia needs to have the default framebuffer bound or the vsync calls fail
glBindFramebuffer(GL_FRAMEBUFFER, 0);
if( i == 1 || i == -1 )
{
int ret = SDL_GL_SetSwapInterval(-1);
@ -78,6 +83,7 @@ namespace PlatformGL
}
else
SDL_GL_SetSwapInterval(0);
}
}