Add FPS rendering on top

This commit is contained in:
Harshit-Dhanwalkar 2026-05-24 17:13:03 +05:30
parent 9eaf33ea36
commit 8a79d2fece
6 changed files with 146 additions and 70 deletions

View file

@ -3,9 +3,19 @@
#include <time.h>
typedef struct {
long samples[16]; // frame duration (ns) ring buffer
int head;
int count;
} fps_counter_t;
// Initialize framerate control
void timing_init(int fps);
void timing_sleep(struct timespec *start_time);
void fps_push(fps_counter_t *fc, long elapsed_ns);
double fps_get(const fps_counter_t *fc);
#endif