z_mirror/sdl-osu
git clone https://git.raiguard.me/z_mirror/sdl-osu
836a89c
trunk
1#pragma once 2#include <SDL3/SDL_stdinc.h> 3 4#define OSU_FRAME_TIME_SAMPLES 60 5 6static const Uint64 UPDATE_DURATION = 1000000000 /1000 ;// Update state at 1000 hz 7static const Uint64 FRAME_DURATION = 1000000000 /1000 ;// Max refresh rate 8 9struct Osu_FrameTiming { 10// Active state 11Uint64 lastFrameTime ; 12Uint64 accumulator ; 13 14// Tracking 15Uint8 frameIndex ; 16Uint64 frameTimes [OSU_FRAME_TIME_SAMPLES ]; 17Uint64 sum ; 18double avgFrameDuration ; 19}; 20 21void Osu_UpdateFrameTiming (struct Osu_FrameTiming * frameTiming );