CRM32Pro SDK
v5.22
|
ITimeSystem. More...
ITimeSystem.
Time system interface class.
Public Member Functions | |
int | GetCurrentLFR () |
Get current Logic Frame Rate (in real time) More... | |
int | GetCurrentRFR () |
Get current Rendering Frame Rate (in real time) More... | |
int | GetDesiredLFR () |
Get desired Logic Frame Rate. More... | |
int | GetDesiredRFR () |
Get desired Rendering Frame Rate. More... | |
float | GetLFR () |
Get the average Logic Frame Rate. More... | |
int | GetLogicFrames () |
Get total logic frames until now. More... | |
int | GetRenderedFrames () |
Get total rendered frames until now. More... | |
float | GetRFR () |
Get the average Rendering Frame Rate. More... | |
float | GetSeconds () |
Get the execution time since the last timer init or reset in seconds. More... | |
int | GetTime () |
Get the execution time since the last timer init or reset in milliseconds. More... | |
int | GetTimeNow () |
Get the execution time since the last timer init or reset in milliseconds. More... | |
void | Info () |
Print a lot of useful information about timer interface. | |
void | Init (int mode=TIMER_INIT) |
Initialize timer system. More... | |
void | SetRate (unsigned int r, unsigned int l) |
Set desired Rendering and Logic Frame Rate. More... | |
Friends | |
class | CRM32Pro_IScreenFX |
class | CRM32Pro_IVideo |
class | CRM32Pro_Main |
int CRM32Pro_ITimeSystem::GetCurrentLFR | ( | ) |
Get current Logic Frame Rate (in real time)
int CRM32Pro_ITimeSystem::GetCurrentRFR | ( | ) |
Get current Rendering Frame Rate (in real time)
int CRM32Pro_ITimeSystem::GetDesiredLFR | ( | ) |
Get desired Logic Frame Rate.
int CRM32Pro_ITimeSystem::GetDesiredRFR | ( | ) |
Get desired Rendering Frame Rate.
float CRM32Pro_ITimeSystem::GetLFR | ( | ) |
Get the average Logic Frame Rate.
int CRM32Pro_ITimeSystem::GetLogicFrames | ( | ) |
Get total logic frames until now.
int CRM32Pro_ITimeSystem::GetRenderedFrames | ( | ) |
Get total rendered frames until now.
float CRM32Pro_ITimeSystem::GetRFR | ( | ) |
Get the average Rendering Frame Rate.
float CRM32Pro_ITimeSystem::GetSeconds | ( | ) |
Get the execution time since the last timer init or reset in seconds.
int CRM32Pro_ITimeSystem::GetTime | ( | ) |
Get the execution time since the last timer init or reset in milliseconds.
The time returned is updated internally by CRM32Pro.Update(). If you have performed some operations or are outside a CRM32Pro.Update() loop it could be unaccurate. This behaviour is on purpose to keep the same time during a loop iteration. However, if you want to have the time now, use GetTimeNow() instead.
int CRM32Pro_ITimeSystem::GetTimeNow | ( | ) |
Get the execution time since the last timer init or reset in milliseconds.
It returns the time now and does not depend on any external update like GetTime().
void CRM32Pro_ITimeSystem::Init | ( | int | mode = TIMER_INIT | ) |
Initialize timer system.
With TIMER_INIT, it initializes or resets all settings of the timer.
With TIMER_RESET, it only resets the timer if it was previously initialized
keeping RFR and LFR at previous assigned rates.
Note that Init(TIMER_RESET) is called internally by CRM32Pro.CleanUp().
mode | TIMER_INIT or TIMER_RESET. By default, TIMER_INIT is selected. |
void CRM32Pro_ITimeSystem::SetRate | ( | unsigned int | r, |
unsigned int | l | ||
) |
Set desired Rendering and Logic Frame Rate.
By default, there are not rate limits. Rendering Frame Rate(RFR) is asynchronous and it does not stop your main loop, it only dumps to video screen at desired rate, in addition, this value can not be guaranteed due to some frames could be dropped to hold stable the Logic Rate.
On the other hand, Logic Frame Rate(LFR) will slow your main loop to given rate. This rate will be stable in a normal situation.
When you are using doublebuffer, the best value for RFR is 0 to match the vertical retrace and to get the smoothest animation.
r | an integer value with desired Rendering Frame Rate. Maximum value is 120. Use 0 if you do not want to limit it. |
l | an integer value with desired Logic Frame Rate. Maximum value is 200. Use 0 if you do not want to limit it. |