delta time usage

This commit is contained in:
Masashi 2025-12-17 16:54:18 +05:30
commit 1b26754f8f
16 changed files with 667 additions and 348 deletions

View file

@ -18,6 +18,11 @@ static AllocationInfo tracked_allocations[MAX_TRACKED_ALLOCATIONS];
static int allocation_count = 0;
static const char *last_error = NULL;
// FPS meter state
static bool fps_meter_visible = false;
static int fps_meter_x = 0;
static int fps_meter_y = 0;
// Simple linear search to find allocation
static int find_allocation(void *ptr) {
for (int i = 0; i < allocation_count; i++) {
@ -78,10 +83,30 @@ void suic_set_target_fps(int fps) { SetTargetFPS(fps); }
void suic_enable_msaa_4x(void) { SetConfigFlags(FLAG_MSAA_4X_HINT); }
// Timing
float suic_get_frame_time(void) { return GetFrameTime(); }
// FPS meter
void suic_show_fps_meter(suic_vec2 position) {
fps_meter_visible = true;
fps_meter_x = (int)position.x;
fps_meter_y = (int)position.y;
}
void suic_hide_fps_meter(void) {
fps_meter_visible = false;
}
// Drawing
void suic_begin_drawing(void) { BeginDrawing(); }
void suic_end_drawing(void) { EndDrawing(); }
void suic_end_drawing(void) {
// Draw FPS meter if enabled
if (fps_meter_visible) {
DrawFPS(fps_meter_x, fps_meter_y);
}
EndDrawing();
}
void suic_clear_background(unsigned char r, unsigned char g, unsigned char b,
unsigned char a) {