1
0
forked from 0ad/0ad

Use SDL_GL_SWAP_CONTROL to control vsync on non-Windows. Fixes #520.

This was SVN commit r7845.
This commit is contained in:
Ykkrosh 2010-08-04 21:30:43 +00:00
parent 65bcedb9fc
commit 51d0abbf2a
2 changed files with 3 additions and 1 deletions

View File

@ -54,7 +54,8 @@ LIB_API void SDL_Quit();
typedef enum
{
SDL_GL_DEPTH_SIZE,
SDL_GL_DOUBLEBUFFER // ignored - always double buffered
SDL_GL_DOUBLEBUFFER, // ignored - always double buffered
SDL_GL_SWAP_CONTROL // not implemented yet
}
SDL_GLattr;

View File

@ -120,6 +120,7 @@ bool CVideoMode::InitSDL()
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24);
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, g_VSync ? 1 : 0);
if (!SetVideoMode(w, h, bpp, m_ConfigFullscreen))
{