mirror of
https://github.com/raysan5/raylib.git
synced 2025-12-25 10:22:33 -05:00
[rcore] [GLFW] [SDL2] Updates CORE.Window.eventWaiting and FLAG_WINDOW_ALWAYS_RUN handling (#4642)
* Add implementation for CORE.Window.eventWaiting on PLATFORM_DESKTOP_SDL * Optimize GetFrameTime() reset * Optimize FLAG_WINDOW_ALWAYS_RUN and GetFrameTime() reset for PLATFORM_DESKTOP_GLFW
This commit is contained in:
@ -1378,7 +1378,11 @@ void PollInputEvents(void)
|
||||
|
||||
CORE.Window.resizedLastFrame = false;
|
||||
|
||||
if (((CORE.Window.flags & FLAG_WINDOW_MINIMIZED) > 0) && ((CORE.Window.flags & FLAG_WINDOW_ALWAYS_RUN) == 0)) SDL_WaitEvent(NULL);
|
||||
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)
|
||||
@ -1499,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:
|
||||
|
||||
Reference in New Issue
Block a user