mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-02 16:08:30 +00:00
Added SDL_DelayPrecise()
SDL_DelayNS() now passes through to the high precision OS delay function, and SDL_DelayPrecise() tries to busy wait to get as close as possible to the desired wait time. Fixes https://github.com/libsdl-org/SDL/issues/11141
This commit is contained in:
@@ -4948,7 +4948,7 @@ static void SDL_SimulateRenderVSync(SDL_Renderer *renderer)
|
||||
elapsed = (now - renderer->last_present);
|
||||
if (elapsed < interval) {
|
||||
Uint64 duration = (interval - elapsed);
|
||||
SDL_DelayNS(duration);
|
||||
SDL_DelayPrecise(duration);
|
||||
now = SDL_GetTicksNS();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user