engine: platform: sdl: don't call SDL_GL_SetSwapInterval each frame while we're not in game

This commit is contained in:
Alibek Omarov 2025-02-25 11:52:03 +03:00
parent a3aaa87147
commit f499286a87

View file

@ -491,7 +491,8 @@ void GL_UpdateSwapInterval( void )
// disable VSync while level is loading
if( cls.state < ca_active )
{
SDL_GL_SetSwapInterval( 0 );
if( SDL_GL_GetSwapInterval() != 0 )
SDL_GL_SetSwapInterval( 0 );
SetBits( gl_vsync.flags, FCVAR_CHANGED );
}
else if( FBitSet( gl_vsync.flags, FCVAR_CHANGED ))