z_mirror/sdl-osu

git clone https://git.raiguard.me/z_mirror/sdl-osu

Caleb HeuerSwitch to four-space indents and inline braces836a89c

trunk
535 B21 linesraw
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
11    Uint64 lastFrameTime;
12    Uint64 accumulator;
13
14    // Tracking
15    Uint8 frameIndex;
16    Uint64 frameTimes[OSU_FRAME_TIME_SAMPLES];
17    Uint64 sum;
18    double avgFrameDuration;
19};
20
21void Osu_UpdateFrameTiming(struct Osu_FrameTiming* frameTiming);