}
}
-static void vg_changevsync(void){
- if( vg.vsync && (vg.vsync_feature != k_vsync_feature_error) ){
+static void vg_changevsync(void)
+{
+ if( vg.vsync && (vg.vsync_feature != k_vsync_feature_error) )
+ {
/* turn on vsync if not enabled */
enum vsync_feature requested = k_vsync_feature_enabled;
if( vg.vsync < 0 ) requested = k_vsync_feature_enabled_adaptive;
- if( vg.vsync_feature != requested ){
+ if( vg.vsync_feature != requested )
+ {
vg_info( "Setting swap interval\n" );
int swap_interval = 1;
if( requested == k_vsync_feature_enabled_adaptive )
swap_interval = -1;
- if( SDL_GL_SetSwapInterval( swap_interval ) == -1 ){
- if( requested == k_vsync_feature_enabled ){
- vg_error( "Vsync is not supported by your system\n" );
- vg_warn( "You may be overriding it in your"
- " graphics control panel.\n" );
+ if( SDL_GL_SetSwapInterval( swap_interval ) == -1 )
+ {
+ if( requested == k_vsync_feature_enabled )
+ {
+ ui_start_modal( &vg_ui.ctx,
+ "Vsync not supported on this system.\n\n"
+ "You may be overriding it in your"
+ " graphics \ncontrol panel.\n",
+ UI_MODAL_BAD );
}
- else{
- vg_error( "Adaptive Vsync is not supported by your system\n" );
+ else
+ {
+ ui_start_modal( &vg_ui.ctx,
+ "Adaptive Vsync is not supported by your system\n\n"
+ "You may be overriding it in your"
+ " graphics \ncontrol panel.\n",
+ UI_MODAL_BAD );
}
vg.vsync_feature = k_vsync_feature_error;
vg.vsync = 0;
- /* TODO: Make popup to notify user that this happened */
}
- else{
+ else
+ {
vg_success( "Vsync enabled (%d)\n", requested );
vg.vsync_feature = requested;
}
ui_rect_center( box, message );
ui_rect row0, row1, btn;
- ui_split_ratio( message, k_ui_axis_h, 0.5f, 0, row0, row1 );
+ ui_split_ratio( message, k_ui_axis_h, 0.76f, 0, row0, row1 );
row0[0] += ctx->font->sx;
ui_ntext( ctx, row0, ctx->modal.message, (box[2]/ctx->font->sx)-2, 1,
k_ui_align_left, colour );