delta time is now updated before evaluating minimum delta time/
parent
a93d09c96c
commit
14b8b2f380
|
@ -85,11 +85,10 @@ 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();
|
||||||
|
do {
|
||||||
while(_delta_time < _min_frame_interval) {
|
|
||||||
timespec_get(&next_time, TIME_UTC);
|
timespec_get(&next_time, TIME_UTC);
|
||||||
_delta_time = timespec_to_sec(next_time) - timespec_to_sec(start_last_frame);
|
_delta_time = timespec_to_sec(next_time) - timespec_to_sec(start_last_frame);
|
||||||
}
|
} while(_delta_time < _min_frame_interval);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue