diff options
author | Red <tfschaefer222@gmail.com> | 2022-10-19 11:49:32 +0300 |
---|---|---|
committer | Red <tfschaefer222@gmail.com> | 2022-10-19 11:49:32 +0300 |
commit | 79e7a262c2ccb053aea5c674a582f2103589884b (patch) | |
tree | feca28a4081c9f94198b2a6db379bae2b3c5cc44 | |
parent | 230509f4335a9bb4ac06e0553dc2ab873915570c (diff) |
Fix(?) for obscure 0.0 deltatime Linux crash
-rw-r--r-- | Source/GUI/dimgui/imgui_impl_sdl_gl3.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/GUI/dimgui/imgui_impl_sdl_gl3.cpp b/Source/GUI/dimgui/imgui_impl_sdl_gl3.cpp index a9b196b1..78bc9cbf 100644 --- a/Source/GUI/dimgui/imgui_impl_sdl_gl3.cpp +++ b/Source/GUI/dimgui/imgui_impl_sdl_gl3.cpp @@ -415,7 +415,8 @@ void ImGui_ImplSdlGL3_NewFrame(SDL_Window* window, bool ignore_mouse) { // Setup time step uint32_t time = SDL_GetTicks(); double current_time = time / 1000.0; - io.DeltaTime = g_Time > 0.0 ? (float)(current_time - g_Time) : (float)(1.0f / 60.0f); + // If the time between frames is greater than 0, use that difference; otherwise default to 60fps + io.DeltaTime = (current_time - g_Time) > 0.0 ? (float)(current_time - g_Time) : (float)(1.0f / 60.0f); g_Time = current_time; if (ignore_mouse) { |