// // Created by darman on 9/24/26. // #include "FrameClock.h" #include #include namespace SiegeDeck::Engine { FrameClock::FrameClock() : frequency(SDL_GetPerformanceFrequency()), lastCounter(SDL_GetPerformanceCounter()) { } void FrameClock::Tick() { uint64 now = SDL_GetPerformanceCounter(); // The first frame measures from construction (startup time), which would read as one long hitch. double elapsed = frameCount == 0 ? 0.0 : static_cast(now - lastCounter) / frequency; lastCounter = now; dt = std::min(elapsed, kMaxDt); time += dt; ++frameCount; } }