this seems to fix the compile on Windows; not sure if it's the best way of doing it, though.

This commit is contained in:
AJ Kelly
2011-05-04 00:26:12 -05:00
parent ca68672e01
commit 0b32783697
2 changed files with 47 additions and 5 deletions
+11 -1
View File
@@ -704,6 +704,11 @@ 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.
@@ -739,11 +744,16 @@ RString RageDisplay_Legacy::TryVideoMode( const VideoModeParams &p, bool &bNewDe
InitShaders();
}
const char *extensions = reinterpret_cast<const char *>(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?) */
if (GLEW_WGL_EXT_swap_control)
wglSwapIntervalEXT = (PFNWGLSWAPINTERVALFARPROC)wglGetProcAddress( "wglSwapIntervalEXT" );
if (wglSwapIntervalEXT)
wglSwapIntervalEXT(p.vsync);
#endif