mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +00:00
OpenGL vsync fixes.
This commit is contained in:
parent
38bf2b8175
commit
415f4a046e
7 changed files with 47 additions and 4 deletions
|
|
@ -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);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue