瀏覽代碼

Reduce delay to 1 ms in SDL_WaitEventTimeout() and SDL_WaitEvent()

The 10 ms delay effectively caps input polling at 100 Hz and rendering
at 100 FPS if applications use these functions in their event loop. The
delay may also lead to dropped frames even at 60 FPS due if they are
unlucky enough to hit the delay and rendering takes longer than 6 ms.
Cameron Gutman 7 年之前
父節點
當前提交
31ee4d3d81
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/events/SDL_events.c

+ 1 - 1
src/events/SDL_events.c

@@ -728,7 +728,7 @@ SDL_WaitEventTimeout(SDL_Event * event, int timeout)
                 /* Timeout expired and no events */
                 return 0;
             }
-            SDL_Delay(10);
+            SDL_Delay(1);
             break;
         default:
             /* Has events */