mirror of
https://github.com/dhewm/dhewm3.git
synced 2025-01-18 23:42:26 +00:00
Use SDL for r_swapInterval
Enables vsync support for more platforms than just Windows.
This commit is contained in:
parent
c0d625685d
commit
29013ff57d
2 changed files with 3 additions and 12 deletions
|
@ -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 ) {
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in a new issue