From 14b8b2f380e14a673295c49f5711b59d22a8977a Mon Sep 17 00:00:00 2001 From: Sara Date: Sun, 18 Jun 2023 22:17:06 +0200 Subject: [PATCH] delta time is now updated before evaluating minimum delta time/ --- src/engine.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/engine.c b/src/engine.c index 515ab9c..110dc9d 100644 --- a/src/engine.c +++ b/src/engine.c @@ -85,11 +85,10 @@ int _engine_run() { update_objects(); // update world objects draw_objects(); // draw world objects swap_buffer(); - - while(_delta_time < _min_frame_interval) { + do { timespec_get(&next_time, TIME_UTC); _delta_time = timespec_to_sec(next_time) - timespec_to_sec(start_last_frame); - } + } while(_delta_time < _min_frame_interval); } return 0; }