Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/WolfireGames/overgrowth.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRed <tfschaefer222@gmail.com>2022-10-19 11:49:32 +0300
committerRed <tfschaefer222@gmail.com>2022-10-19 11:49:32 +0300
commit79e7a262c2ccb053aea5c674a582f2103589884b (patch)
treefeca28a4081c9f94198b2a6db379bae2b3c5cc44
parent230509f4335a9bb4ac06e0553dc2ab873915570c (diff)
Fix(?) for obscure 0.0 deltatime Linux crash
-rw-r--r--Source/GUI/dimgui/imgui_impl_sdl_gl3.cpp3
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) {