feat: integrate TUI module and apply professional refactoring

This commit is contained in:
2026-04-16 20:39:48 +00:00
parent 42529be0f8
commit 72e0ef4022
18 changed files with 1340 additions and 2106 deletions

View File

@@ -1,10 +1,3 @@
/**
* @file timing.h
* @brief High-precision timing utilities
* @author ASCII3D Project
* @version 1.0.0
*/
#ifndef ASCII3D_TIMING_H
#define ASCII3D_TIMING_H
@@ -12,27 +5,18 @@
extern "C" {
#endif
/**
* @brief Get current time in seconds (monotonic clock)
* @return Time in seconds with nanosecond precision
*/
// Returns the monotonic wall clock time in seconds, suitable for frame timing.
double timing_get_seconds(void);
/**
* @brief Sleep for specified microseconds
* @param microseconds Duration to sleep
*/
// Microsecond-scale thread suspension layer.
void timing_sleep_us(unsigned int microseconds);
/**
* @brief Frame rate limiter - sleeps to maintain target FPS
* @param frame_start_time Time when frame started (from timing_get_seconds)
* @param target_fps Target frames per second
*/
// Calculates dynamic sleep padding against a target FPS to prevent high CPU
// utilization
void timing_limit_fps(double frame_start_time, int target_fps);
#ifdef __cplusplus
}
#endif
#endif /* ASCII3D_TIMING_H */
#endif