VG_SYNC_LOG( "[%d] vg_acquire_thread_sync()\n" );
_vg_ensure_engine_running();
SDL_AtomicLock( &vg.sl_context );
VG_SYNC_LOG( "[%d] vg_acquire_thread_sync()\n" );
_vg_ensure_engine_running();
SDL_AtomicLock( &vg.sl_context );
SDL_GL_MakeCurrent( vg.window, vg.gl_context );
VG_SYNC_LOG( "[%d] granted\n" );
}
SDL_GL_MakeCurrent( vg.window, vg.gl_context );
VG_SYNC_LOG( "[%d] granted\n" );
}
vg.context_ownership_depth ++;
VG_SYNC_LOG( "[%d] granted\n" );
SDL_AtomicUnlock( &vg.sl_context );
vg.context_ownership_depth ++;
VG_SYNC_LOG( "[%d] granted\n" );
SDL_AtomicUnlock( &vg.sl_context );
VG_SYNC_LOG( "[%d] vg_release_thread_sync()\n" );
SDL_AtomicLock( &vg.sl_context );
vg.context_ownership_depth --;
VG_SYNC_LOG( "[%d] vg_release_thread_sync()\n" );
SDL_AtomicLock( &vg.sl_context );
vg.context_ownership_depth --;
SDL_AtomicUnlock( &vg.sl_context );
VG_SYNC_LOG( "[%d] Releasing context.\n" );
SDL_GL_MakeCurrent( NULL, NULL );
SDL_AtomicUnlock( &vg.sl_context );
VG_SYNC_LOG( "[%d] Releasing context.\n" );
SDL_GL_MakeCurrent( NULL, NULL );
VG_SYNC_LOG( "[%d] _vg_run_synced() (%d).\n", vg.exec_context );
vg.exec_context = 0;
SDL_AtomicUnlock( &vg.sl_context );
VG_SYNC_LOG( "[%d] _vg_run_synced() (%d).\n", vg.exec_context );
vg.exec_context = 0;
SDL_AtomicUnlock( &vg.sl_context );
VG_SYNC_LOG( "[%d] Re-engaging.\n" );
SDL_GL_MakeCurrent( vg.window, vg.gl_context );
}
VG_SYNC_LOG( "[%d] Re-engaging.\n" );
SDL_GL_MakeCurrent( vg.window, vg.gl_context );
}
- else if( event.type == SDL_WINDOWEVENT )
- {
- if( event.window.event == SDL_WINDOWEVENT_SIZE_CHANGED )
- {
+ else if( event.type == SDL_WINDOWEVENT ){
+ if( event.window.event == SDL_WINDOWEVENT_SIZE_CHANGED ){
vg_warn( "Got a invalid framebuffer size: "
"%dx%d... ignoring\n", w, h );
}
vg_warn( "Got a invalid framebuffer size: "
"%dx%d... ignoring\n", w, h );
}
(ui_rect){ 4, 4, 250, 0 }, 0
);
(ui_rect){ 4, 4, 250, 0 }, 0
);
- while( vg_argp( argc, argv ) )
- {
- if( (arg = vg_opt_arg( 'w' )) )
- {
+ while( vg_argp( argc, argv ) ){
+ if( (arg = vg_opt_arg( 'w' )) ){
SDL_GL_GetDrawableSize( vg.window, &vg.window_x, &vg.window_y );
vg_success( "Window created (%dx%d)\n", vg.window_x, vg.window_y );
}
SDL_GL_GetDrawableSize( vg.window, &vg.window_x, &vg.window_y );
vg_success( "Window created (%dx%d)\n", vg.window_x, vg.window_y );
}
vg_fatal_exit_loop( "Cannot enable Vsync! You might be overriding it"
" in your graphics control panel.\n" );
}
vg_fatal_exit_loop( "Cannot enable Vsync! You might be overriding it"
" in your graphics control panel.\n" );
}
- if( !SDL_GetWindowDisplayMode( vg.window, &dispmode ) )
- {
- if( dispmode.refresh_rate )
- {
+ 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.refresh_rate = dispmode.refresh_rate;
vg_info( "Refresh rate: %d\n", dispmode.refresh_rate );
}
size = backtrace( array, 20 );
strings = backtrace_symbols( array, size );
size = backtrace( array, 20 );
strings = backtrace_symbols( array, size );
vg_error( "Fatal error: %s\n", error );
SDL_AtomicLock( &vg.sl_context );
vg_error( "Fatal error: %s\n", error );
SDL_AtomicLock( &vg.sl_context );