From: hgn Date: Fri, 5 Jan 2024 03:45:58 +0000 (+0000) Subject: fix swap profile X-Git-Url: https://harrygodden.com/git/?a=commitdiff_plain;h=27b74ba6426c84c98ae777a095be31377e87037d;hp=6f195c9ff48df906b5ac5418ad669df7acea6ef2;p=vg.git fix swap profile --- diff --git a/vg.h b/vg.h index 2f6f340..987ed73 100644 --- a/vg.h +++ b/vg.h @@ -639,11 +639,14 @@ static void _vg_gameloop(void){ vg_changevsync(); - vg_profile_begin( &vg_prof_swap ); + enum engine_status status = _vg_engine_status(); + if( status == k_engine_status_running ) + vg_profile_begin( &vg_prof_swap ); + SDL_GL_SwapWindow( vg.window ); - vg_profile_end( &vg_prof_swap ); - enum engine_status status = _vg_engine_status(); + if( status == k_engine_status_running ) + vg_profile_end( &vg_prof_swap ); vg.time_real += vg.time_frame_delta; vg.time_delta = vg.time_frame_delta * vg.time_rate;