diff --git a/src/RageDisplay_OGL.cpp b/src/RageDisplay_OGL.cpp index 8bdef356c1..8f45c2a326 100644 --- a/src/RageDisplay_OGL.cpp +++ b/src/RageDisplay_OGL.cpp @@ -22,6 +22,8 @@ using namespace RageDisplay_Legacy_Helpers; #include +#include + #if defined(_MSC_VER) #pragma comment(lib, "opengl32.lib") #pragma comment(lib, "glu32.lib") @@ -704,11 +706,6 @@ void RageDisplay_Legacy::ResolutionChanged() RageDisplay::ResolutionChanged(); } -#if defined(WINDOWS) - typedef BOOL (APIENTRY *PFNWGLSWAPINTERVALFARPROC)( int ); - PFNWGLSWAPINTERVALFARPROC wglSwapIntervalEXT = 0; -#endif - // Return true if mode change was successful. // bNewDeviceOut is set true if a new device was created and textures // need to be reloaded. @@ -744,17 +741,14 @@ RString RageDisplay_Legacy::TryVideoMode( const VideoModeParams &p, bool &bNewDe InitShaders(); } - const char *extensions = reinterpret_cast(glGetString( GL_EXTENSIONS )); // I'm not sure this is correct -Colby #if defined(WINDOWS) - if( strstr( extensions, "WGL_EXT_swap_control" ) == 0 ) - return RString("The WGL_EXT_swap_control extension is not supported on your computer."); - /* Set vsync the Windows way, if we can. (What other extensions are there * to do this, for other archs?) */ - wglSwapIntervalEXT = (PFNWGLSWAPINTERVALFARPROC)wglGetProcAddress( "wglSwapIntervalEXT" ); - if (wglSwapIntervalEXT) + if( wglewIsSupported("WGL_EXT_swap_control") ) wglSwapIntervalEXT(p.vsync); + else + return RString("The WGL_EXT_swap_control extension is not supported on your computer."); #endif ResolutionChanged();