浏览代码

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.

Alex Szpakowski 9 年之前
父节点
当前提交
33af421d7b
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      src/timer/windows/SDL_systimer.c

+ 4 - 0
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
 }