#pragma once #include #define OSU_FRAME_TIME_SAMPLES 60 static const Uint64 UPDATE_DURATION = 1000000000 / 1000; // Update state at 1000 hz static const Uint64 FRAME_DURATION = 1000000000 / 1000; // Max refresh rate struct Osu_FrameTiming { // Active state Uint64 lastFrameTime; Uint64 accumulator; // Tracking Uint8 frameIndex; Uint64 frameTimes[OSU_FRAME_TIME_SAMPLES]; Uint64 sum; double avgFrameDuration; }; void Osu_UpdateFrameTiming(struct Osu_FrameTiming* frameTiming);