From 27b74ba6426c84c98ae777a095be31377e87037d Mon Sep 17 00:00:00 2001 From: hgn Date: Fri, 5 Jan 2024 03:45:58 +0000 Subject: [PATCH 1/1] fix swap profile --- vg.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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; -- 2.25.1