Skip to content

Commit

Permalink
Windows: make sure SDL_TicksInit has been called before calling Sleep…
Browse files Browse the repository at this point in the history
…(ms) in SDL_Delay. This ensures the Windows system timer resolution is properly set before Sleep is called.
  • Loading branch information
slime73 committed Feb 15, 2016
1 parent 37a5416 commit 33af421
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/timer/windows/SDL_systimer.c
Expand Up @@ -189,6 +189,10 @@ SDL_Delay(Uint32 ms)
}
WaitForSingleObjectEx(mutex, ms, FALSE);
#else
if (!ticks_started) {
SDL_TicksInit();
}

Sleep(ms);
#endif
}
Expand Down

0 comments on commit 33af421

Please sign in to comment.