Windows: make sure SDL_TicksInit has been called before calling Sleep(ms) in SDL_Delay. This ensures the Windows system timer resolution is properly set before Sleep is called.

This commit is contained in:
Alex Szpakowski 2016-02-14 21:17:25 -04:00
parent 37a5416784
commit 33af421d7b
1 changed files with 4 additions and 0 deletions

View File

@ -189,6 +189,10 @@ SDL_Delay(Uint32 ms)
}
WaitForSingleObjectEx(mutex, ms, FALSE);
#else
if (!ticks_started) {
SDL_TicksInit();
}
Sleep(ms);
#endif
}