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; }