fix: target delta time is now enforced

This commit is contained in:
Sara Gerretsen 2025-09-23 12:57:18 +02:00
parent dd01f9488f
commit 17f78ef57d

View file

@ -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();
}
}