Add vid_vsync support to Linux target

This commit is contained in:
Magnus Norddahl 2016-11-24 07:37:15 +01:00 committed by Christoph Oelckers
parent b3b5cb2fa4
commit 4eb32a50e3

View file

@ -442,6 +442,16 @@ void SDLGLFB::SetVSync( bool vsync )
#if defined (__APPLE__) #if defined (__APPLE__)
const GLint value = vsync ? 1 : 0; const GLint value = vsync ? 1 : 0;
CGLSetParameter( CGLGetCurrentContext(), kCGLCPSwapInterval, &value ); CGLSetParameter( CGLGetCurrentContext(), kCGLCPSwapInterval, &value );
#else
if (vsync)
{
if (SDL_GL_SetSwapInterval(-1) == -1)
SDL_GL_SetSwapInterval(1);
}
else
{
SDL_GL_SetSwapInterval(0);
}
#endif #endif
} }