CRM32Pro_ITimeSystem Class Reference
[MODULE 11: ITimeSystem v1.70, timer system interface]

ITimeSystem. More...


Detailed Description

ITimeSystem.

Time system interface class.

List of all members.

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

Member Function Documentation

int CRM32Pro_ITimeSystem::GetCurrentLFR (  ) 

Get current Logic Frame Rate (in real time).

Returns:
-1 Failed
an integer variable with the current Logic Frame Rate.
int CRM32Pro_ITimeSystem::GetCurrentRFR (  ) 

Get current Rendering Frame Rate (in real time).

Returns:
-1 Failed
an integer variable with the current Rendering Frame Rate.
Examples:
Example08_SpriteCollision.cpp, and Example09_LogicRenderRates.cpp.
int CRM32Pro_ITimeSystem::GetDesiredLFR (  ) 

Get desired Logic Frame Rate.

Returns:
-1 Failed
an integer with desired logic rate
Examples:
Example09_LogicRenderRates.cpp.
int CRM32Pro_ITimeSystem::GetDesiredRFR (  ) 

Get desired Rendering Frame Rate.

Returns:
-1 Failed
an integer with desired rendering rate
Examples:
Example09_LogicRenderRates.cpp.
float CRM32Pro_ITimeSystem::GetLFR (  ) 

Get the average Logic Frame Rate.

Returns:
-1 Failed
a float variable with the average of Logic Frame Rate.
int CRM32Pro_ITimeSystem::GetLogicFrames (  ) 

Get total logic frames until now.

Returns:
-1 Failed
an integer variable with the total number of logic frames.
int CRM32Pro_ITimeSystem::GetRenderedFrames (  ) 

Get total rendered frames until now.

Returns:
-1 Failed
an integer variable with the total number of rendered frames.
float CRM32Pro_ITimeSystem::GetRFR (  ) 

Get the average Rendering Frame Rate.

Returns:
-1 Failed
a float variable with the average of Rendering Frame Rate.
float CRM32Pro_ITimeSystem::GetSeconds (  ) 

Get the execution time in seconds.

Returns:
-1 Failed
a float variable with the execution time(in seconds) since Init().
Examples:
SpacePong.cpp.
int CRM32Pro_ITimeSystem::GetTime (  ) 

Get the execution time in milliseconds.

Returns:
-1 Failed
an integer variable with the execution time(in milliseconds) since Init().
Examples:
Example08_SpriteCollision.cpp, and Example09_LogicRenderRates.cpp.
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().

Parameters:
mode TIMER_INIT or TIMER_RESET. By default, TIMER_INIT is selected.
Examples:
Example01_BasicCode.cpp, Example03_GUI.cpp, Example08_SpriteCollision.cpp, Example09_LogicRenderRates.cpp, and SpacePong.cpp.
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.

Parameters:
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.
Examples:
Example01_BasicCode.cpp, Example03_GUI.cpp, Example08_SpriteCollision.cpp, Example09_LogicRenderRates.cpp, and SpacePong.cpp.

The documentation for this class was generated from the following files:

Generated on Mon Dec 21 17:04:40 2009 for CRM32Pro SDK v5.00 by  doxygen 1.6.1