added frame limiting

pull/8/head
Sara 2023-06-18 18:02:22 +02:00
parent d69b92a464
commit 56679110e3
1 changed files with 5 additions and 0 deletions

View File

@ -86,6 +86,11 @@ int _engine_run() {
update_objects(); // update world objects update_objects(); // update world objects
draw_objects(); // draw world objects draw_objects(); // draw world objects
swap_buffer(); swap_buffer();
while(_delta_time < _min_frame_interval) {
timespec_get(&next_time, TIME_UTC);
_delta_time = timespec_to_sec(next_time) - timespec_to_sec(start_last_frame);
}
} }
return 0; return 0;
} }