FPSTimer Class Reference

Timer class used for game engine FPS consistency purposes. More...

#include <fpstimer.h>

List of all members.

Public Member Functions

 FPSTimer ()
 Constructor.
void setFPSLock (double fps)
 Set the fps to lock the frame rate to; used in delay().
void setLastFrame (int ticks)
 Set the time that the last frame was drawn.
double deltaSeconds (int ticks1, int ticks2)
 Calculate delta in seconds between two sets of ticks.
void delay ()
 Delay the engine until the locked FPS rate is reached.

Private Attributes

int m_LastFrame
 The last time a frame was drawn.
double m_FPSLock
 Rate of FPS to lock.


Detailed Description

Timer class used for game engine FPS consistency purposes.

Since not all computers run graphics games at equal speeds, this class is responsible for keeping the frame rate at a reasonable level


Member Function Documentation

void FPSTimer::setFPSLock ( double  fps  )  [inline]

Set the fps to lock the frame rate to; used in delay().

Parameters:
fps The frame rate

void FPSTimer::setLastFrame ( int  ticks  )  [inline]

Set the time that the last frame was drawn.

Parameters:
ticks Last frame's drawing time

double FPSTimer::deltaSeconds ( int  ticks1,
int  ticks2 
)

Calculate delta in seconds between two sets of ticks.

Parameters:
ticks1 The first tick count
ticks2 The second tick count
Returns:
The difference between the two ticks, in seconds


The documentation for this class was generated from the following files:
Generated on Fri Feb 22 22:29:23 2008 for Phoenix Wright Case Player API by  doxygen 1.5.3