0
0
Fork 0
mirror of https://git.sr.ht/~rabbits/uxn synced 2024-11-23 14:25:10 +00:00

Reduce refresh requests without screen vector

This commit is contained in:
Devine Lu Linvega 2023-01-26 09:35:56 -08:00
parent 6d95f000b1
commit b5fa665cdb

View file

@ -445,10 +445,13 @@ run(Uxn *u)
if(uxn_screen.fg.changed || uxn_screen.bg.changed)
redraw();
now = SDL_GetPerformanceCounter();
if(u->dev[0x20]) {
if(!BENCH && ((Sint64)(frame_end - now)) > 0) {
SDL_Delay((frame_end - now) / ms_interval);
now = frame_end;
}
} else
SDL_WaitEvent(NULL);
}
return error("SDL_WaitEvent", SDL_GetError());
}