+
+ vg_info( "Setting swap interval\n" );
+
+ if( SDL_GL_SetSwapInterval( -1 ) == -1 )
+ {
+ vg_warn( "Adaptive Vsync not supported\n" );
+
+ if( SDL_GL_SetSwapInterval( 1 ) == -1 )
+ {
+ vg_fatal_exit_loop( "Cannot enable Vsync! You might be overriding it"
+ " in your graphics control panel.\n" );
+ }
+ else
+ vg_success( "Using vsync\n" );
+ }
+ else
+ vg_success( "Using adaptive Vsync\n" );
+
+ SDL_DisplayMode dispmode;
+ if( !SDL_GetWindowDisplayMode( vg.window, &dispmode ) )
+ {
+ if( dispmode.refresh_rate )
+ {
+ vg.refresh_rate = dispmode.refresh_rate;
+ vg_info( "Refresh rate: %d\n", dispmode.refresh_rate );
+ }
+ }