vg.refresh_rate = mode.refresh_rate;
- vg_info( "CreateWindow\n" );
+ if( !vg.window_x )
+ vg.window_x = mode.w;
+
+ if( !vg.window_y )
+ vg.window_y = mode.h;
+
+ vg_info( "CreateWindow( %d %d )\n", vg.window_x, vg.window_y );
/* TODO: Allow selecting closest video mode from launch opts */
if((vg.window = SDL_CreateWindow( window_name,
SDL_WINDOWPOS_UNDEFINED,
SDL_WINDOWPOS_UNDEFINED,
- mode.w, mode.h,
+ vg.window_x, vg.window_y,
SDL_WINDOW_FULLSCREEN_DESKTOP |
SDL_WINDOW_OPENGL |
}
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 );
+ }
+ }
}
VG_STATIC void vg_enter( int argc, char *argv[], const char *window_name )