diff --git a/stepmania/src/RageDisplay.cpp b/stepmania/src/RageDisplay.cpp index c7da8a6a0e..d8ea88c4af 100644 --- a/stepmania/src/RageDisplay.cpp +++ b/stepmania/src/RageDisplay.cpp @@ -61,6 +61,9 @@ static int g_iFramesRenderedSinceLastCheck, set g_glExts; static bool g_GL_EXT_texture_env_combine; +typedef BOOL (APIENTRY * PWSWAPINTERVALEXTPROC) (int interval); +PWSWAPINTERVALEXTPROC wglSwapIntervalEXT; + void GetGLExtensions(set &ext) { const char *buf = (const char *)glGetString(GL_EXTENSIONS); @@ -90,6 +93,10 @@ RageDisplay::RageDisplay( bool windowed, int width, int height, int bpp, int rat glBlendFuncSeparate = (PFNGLBLENDFUNCSEPARATEPROC) SDL_GL_GetProcAddress ("glBlendFuncSeparate"); + /* Windows vsync: */ + if(g_glExts.find("WGL_EXT_swap_control") != g_glExts.end()) + wglSwapIntervalEXT = (PWSWAPINTERVALEXTPROC) SDL_GL_GetProcAddress("wglSwapIntervalEXT"); + SetupOpenGL(); } @@ -172,6 +179,11 @@ bool RageDisplay::SetVideoMode( bool windowed, int width, int height, int bpp, i } #endif + /* Set vsync the Windows way, if we can. (What other extensions are there + * to do this, for other archs?) */ + if(wglSwapIntervalEXT) + wglSwapIntervalEXT(vsync); + if(!g_screen) { g_screen = SDL_SetVideoMode(width, height, bpp, g_flags); if(!g_screen)