From 17f78ef57d8791af4e7d7d8771793b325f0560bb Mon Sep 17 00:00:00 2001 From: Sara Gerretsen Date: Tue, 23 Sep 2025 12:57:18 +0200 Subject: [PATCH] fix: target delta time is now enforced --- src/application.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/application.cpp b/src/application.cpp index a2e8ea8..63b3a58 100644 --- a/src/application.cpp +++ b/src/application.cpp @@ -154,7 +154,9 @@ Clay_RenderCommandArray RenderApplication() { static uint64_t lastStep = 0; if (isSimulating) { double deltaTime{ (double)(SDL_GetTicks() - lastStep) * 0.001 }; - if (deltaTime > 0.16) { + constexpr double targetDeltaTime = 1.0/24.0; + if (deltaTime > targetDeltaTime) { + lastStep = SDL_GetTicks(); simulation::Step(); } }