Use SDL for r_swapInterval

Enables vsync support for more platforms than just Windows.
This commit is contained in:
dhewg 2011-12-31 03:40:46 +01:00
parent c0d625685d
commit 29013ff57d
2 changed files with 3 additions and 12 deletions

View file

@ -1836,18 +1836,6 @@ static void GfxInfo_f( const idCmdArgs &args ) {
common->Printf( "glFinish not forced\n" );
}
#ifdef _WIN32
// WGL_EXT_swap_interval
typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval);
extern PFNWGLSWAPINTERVALEXTPROC wglSwapIntervalEXT;
if ( r_swapInterval.GetInteger() && wglSwapIntervalEXT ) {
common->Printf( "Forcing swapInterval %i\n", r_swapInterval.GetInteger() );
} else {
common->Printf( "swapInterval not forced\n" );
}
#endif
bool tss = glConfig.twoSidedStencilAvailable || glConfig.atiTwoSidedStencilAvailable;
if ( !r_useTwoSidedStencil.GetBool() && tss ) {

View file

@ -129,6 +129,9 @@ bool GLimp_Init(glimpParms_t parms) {
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, parms.multiSamples ? 1 : 0);
SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, parms.multiSamples);
if (SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, r_swapInterval.GetInteger()) < 0)
common->Warning("SDL_GL_SWAP_CONTROL not supported");
surf = SDL_SetVideoMode(parms.width, parms.height, colorbits, flags);
if (!surf) {
common->DPrintf("Couldn't set GL mode %d/%d/%d: %s",