From c8f0f7c47dff4bda402f71298fb5fa101b485ec9 Mon Sep 17 00:00:00 2001 From: asdqwe Date: Wed, 18 Dec 2024 23:24:07 -0300 Subject: [PATCH] Add reset for GetFrameTime() --- src/platforms/rcore_desktop_glfw.c | 7 ++++++- src/platforms/rcore_desktop_sdl.c | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/platforms/rcore_desktop_glfw.c b/src/platforms/rcore_desktop_glfw.c index 0d95cdd7..aee12b04 100644 --- a/src/platforms/rcore_desktop_glfw.c +++ b/src/platforms/rcore_desktop_glfw.c @@ -1739,7 +1739,12 @@ static void WindowContentScaleCallback(GLFWwindow *window, float scalex, float s static void WindowIconifyCallback(GLFWwindow *window, int iconified) { if (iconified) CORE.Window.flags |= FLAG_WINDOW_MINIMIZED; // The window was iconified - else CORE.Window.flags &= ~FLAG_WINDOW_MINIMIZED; // The window was restored + else + { + CORE.Window.flags &= ~FLAG_WINDOW_MINIMIZED; // The window was restored + + if ((CORE.Window.flags & FLAG_WINDOW_ALWAYS_RUN) == 0) CORE.Time.previous = GetTime(); + } } // GLFW3 WindowMaximize Callback, runs when window is maximized/restored diff --git a/src/platforms/rcore_desktop_sdl.c b/src/platforms/rcore_desktop_sdl.c index 493f315d..dd98a729 100644 --- a/src/platforms/rcore_desktop_sdl.c +++ b/src/platforms/rcore_desktop_sdl.c @@ -1499,6 +1499,8 @@ 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: