X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=vg.h;h=987ed73f7d3504c9785bfe9a67fe6447bde44e95;hb=27b74ba6426c84c98ae777a095be31377e87037d;hp=2f6f340ac31d82078d02f53144f39f8e09437b8f;hpb=6f195c9ff48df906b5ac5418ad669df7acea6ef2;p=vg.git 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;