X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=vg.h;h=2acdfc529053caef494352933b74530a909fcb0c;hb=ba09ee4b8ed1d994f0e97c8c34f221dc13555195;hp=f839f02e60e1848573d68c6a52df6467cd64ad36;hpb=984ae77a4c0b6b90ac2fea140d1a6a1230556ad2;p=vg.git diff --git a/vg.h b/vg.h index f839f02..2acdfc5 100644 --- a/vg.h +++ b/vg.h @@ -141,6 +141,7 @@ struct vg{ /* Runtime */ double time, + time_real, time_delta, time_rate, @@ -466,7 +467,7 @@ VG_STATIC void _vg_gameloop_render(void) vg.samples, vg.fixed_iterations, (vg.time_fixed_accumulator/VG_TIMESTEP_FIXED)*100.0f, - vg.time, vg.time_delta, vg.time_rate, + vg.time_real, vg.time_delta, vg.time_rate, vg.time_fixed_extrapolate, vg.time_frame_delta, vg.time_spinning ); @@ -557,7 +558,7 @@ VG_STATIC int _vg_crashscreen(void) glBlendFunc(GL_ONE_MINUS_DST_ALPHA, GL_DST_ALPHA); glBlendEquation(GL_FUNC_ADD); - glClearColor( 0.15f + sinf(vg.time)*0.1f, 0.0f, 0.0f,1.0f ); + glClearColor( 0.15f + sinf(vg.time_real)*0.1f, 0.0f, 0.0f,1.0f ); glClear( GL_COLOR_BUFFER_BIT ); glViewport( 0,0, vg.window_x, vg.window_y ); @@ -592,6 +593,7 @@ VG_STATIC void _vg_gameloop(void){ enum engine_status status = _vg_engine_status(); + vg.time_real += vg.time_frame_delta; vg.time_delta = vg.time_frame_delta * vg.time_rate; vg.time += vg.time_delta;