added frame limiting
parent
d69b92a464
commit
56679110e3
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue