delta time is now updated before evaluating minimum delta time/

pull/8/head
Sara 2023-06-18 22:17:06 +02:00
parent a93d09c96c
commit 14b8b2f380
1 changed files with 2 additions and 3 deletions

View File

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