You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.4 KiB
42 lines
1.4 KiB
#ifndef __TIME_H__
|
|
#define __TIME_H__
|
|
|
|
void time_init();
|
|
void time_tick();
|
|
|
|
/**
|
|
* @brief Get the real-time clock value.
|
|
* Note that this value will constantly update and change, so don't expect this value to remain consistent during a single frame.
|
|
* @return The real-time clock value in 20,12 format.
|
|
*/
|
|
u_long time_getRealTime();
|
|
|
|
/**
|
|
* @brief Get the current frame count.
|
|
* This is the number of frames that were counted, i.e. the number of main loop iterations since application start.
|
|
* @return The current frame's number in 32,0 format.
|
|
*/
|
|
u_long time_getFrameNumber();
|
|
|
|
/**
|
|
* @brief Get the current frame start time.
|
|
* The real-time value at which the current frame was started. Unlike time_getRealTime(), this value remains consistent for the entire frame.
|
|
* @return The current frame's start time in 20,12 format.
|
|
*/
|
|
u_long time_getFrameTime();
|
|
|
|
/**
|
|
* @brief Get the delta time between frames.
|
|
* The amount of real time passed between the last frame and the current frame. Use this for framerate-independent time stepping.
|
|
* @return The frame delta time in 4,12 format.
|
|
*/
|
|
u_short time_getDeltaTime();
|
|
|
|
/**
|
|
* @brief Get the average frame rate.
|
|
* The average framerate calculated over 16 frames. This gets updated periodically so isn't always entirely current.
|
|
* @return The average frame rate in 8,8 format.
|
|
*/
|
|
u_short time_getFrameRate();
|
|
|
|
#endif // __TIME_H__
|