瀏覽代碼

Optimize GetFrameTime() reset

pull/4642/head
asdqwe 3 月之前
父節點
當前提交
565be7d3a3
共有 1 個文件被更改,包括 5 次插入4 次删除
  1. +5
    -4
      src/platforms/rcore_desktop_sdl.c

+ 5
- 4
src/platforms/rcore_desktop_sdl.c 查看文件

@ -1378,8 +1378,11 @@ void PollInputEvents(void)
CORE.Window.resizedLastFrame = false;
if ((CORE.Window.eventWaiting) || (((CORE.Window.flags & FLAG_WINDOW_MINIMIZED) > 0) && ((CORE.Window.flags & FLAG_WINDOW_ALWAYS_RUN) == 0))) SDL_WaitEvent(NULL);
if (CORE.Window.eventWaiting) CORE.Time.previous = GetTime();
if ((CORE.Window.eventWaiting) || (((CORE.Window.flags & FLAG_WINDOW_MINIMIZED) > 0) && ((CORE.Window.flags & FLAG_WINDOW_ALWAYS_RUN) == 0)))
{
SDL_WaitEvent(NULL);
CORE.Time.previous = GetTime();
}
SDL_Event event = { 0 };
while (SDL_PollEvent(&event) != 0)
@ -1500,8 +1503,6 @@ void PollInputEvents(void)
if ((CORE.Window.flags & SDL_WINDOW_MAXIMIZED) > 0) CORE.Window.flags &= ~SDL_WINDOW_MAXIMIZED;
}
#endif
if ((CORE.Window.flags & FLAG_WINDOW_ALWAYS_RUN) == 0) CORE.Time.previous = GetTime();
} break;
case SDL_WINDOWEVENT_HIDDEN:

Loading…
取消
儲存