From 33af421d7b646721b80c54e25fcdd1df9497ccb3 Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Sun, 14 Feb 2016 21:17:25 -0400 Subject: [PATCH] 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. --- src/timer/windows/SDL_systimer.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/timer/windows/SDL_systimer.c b/src/timer/windows/SDL_systimer.c index abfbcb99a..d2d30c8da 100644 --- a/src/timer/windows/SDL_systimer.c +++ b/src/timer/windows/SDL_systimer.c @@ -189,6 +189,10 @@ SDL_Delay(Uint32 ms) } WaitForSingleObjectEx(mutex, ms, FALSE); #else + if (!ticks_started) { + SDL_TicksInit(); + } + Sleep(ms); #endif }