forked from Green-Sky/tomato
limit max main loop sleep
This commit is contained in:
parent
671772a20e
commit
f716ad9dd1
@ -178,9 +178,13 @@ int main(int argc, char** argv) {
|
|||||||
//)
|
//)
|
||||||
//));
|
//));
|
||||||
|
|
||||||
const float min_delay = std::min<float>(
|
const float min_delay =
|
||||||
|
std::min<float>(
|
||||||
|
std::min<float>(
|
||||||
screen->nextTick() - time_delta_tick,
|
screen->nextTick() - time_delta_tick,
|
||||||
screen->nextRender() - time_delta_render
|
screen->nextRender() - time_delta_render
|
||||||
|
),
|
||||||
|
0.25f // dont sleep too long
|
||||||
) * 1000.f;
|
) * 1000.f;
|
||||||
|
|
||||||
if (min_delay > 0.f) {
|
if (min_delay > 0.f) {
|
||||||
|
Loading…
Reference in New Issue
Block a user