ITimeSystem. More...
ITimeSystem.
Time system interface class.
Public Member Functions | |
| int | GetCurrentLFR () |
| Get current Logic Frame Rate (in real time). | |
| int | GetCurrentRFR () |
| Get current Rendering Frame Rate (in real time). | |
| int | GetDesiredLFR () |
| Get desired Logic Frame Rate. | |
| int | GetDesiredRFR () |
| Get desired Rendering Frame Rate. | |
| float | GetLFR () |
| Get the average Logic Frame Rate. | |
| int | GetLogicFrames () |
| Get total logic frames until now. | |
| int | GetRenderedFrames () |
| Get total rendered frames until now. | |
| float | GetRFR () |
| Get the average Rendering Frame Rate. | |
| float | GetSeconds () |
| Get the execution time in seconds. | |
| int | GetTime () |
| Get the execution time in milliseconds. | |
| void | Info () |
| Print a lot of useful information about timer interface. | |
| void | Init (int mode=TIMER_INIT) |
| Initialize timer system. | |
| void | SetRate (unsigned int r, unsigned int l) |
| Set desired Rendering and Logic Frame Rate. | |
Friends | |
| 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 in seconds.
| int CRM32Pro_ITimeSystem::GetTime | ( | ) |
Get the execution time in milliseconds.
| 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. |
1.6.1