Main Page | Namespace List | Class Hierarchy | Compound List | File List | Namespace Members | Compound Members | File Members | Related Pages

CFPSTimer Class Reference

#include <ctimer.h>

Inheritance diagram for CFPSTimer:

Inheritance graph
[legend]
Collaboration diagram for CFPSTimer:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 CFPSTimer (unsigned long max_frame_time)
void restart ()
void update ()
unsigned long get_fps ()
unsigned long get_time_passed ()

Detailed Description

The CPSTimer class contains time-tracking statistics for the game, including frames per second and the amount of game "ticks" that have passed so far this frame.

Definition at line 20 of file ctimer.h.


Constructor & Destructor Documentation

CFPSTimer::CFPSTimer unsigned long  max_frame_time  )  [inline]
 

Creates a new FPS timer with the given max frame time.

Definition at line 41 of file ctimer.h.


Member Function Documentation

unsigned long CFPSTimer::get_fps  )  [inline]
 

Returns the frames per second.

Definition at line 47 of file ctimer.h.

unsigned long CFPSTimer::get_time_passed  )  [inline]
 

Returns the number of milliseconds that the last frame took to render. Useful for telling a finite state machine how much time has passed since it was last updated, etc...

Definition at line 51 of file ctimer.h.

void CFPSTimer::restart  ) 
 

Restarts the FPS timer.

Definition at line 7 of file ctimer.cpp.

References CSingletonManager< CTimerSystem >::get_instance(), and CTimerSystem::get_ticks().

Here is the call graph for this function:

void CFPSTimer::update  ) 
 

Updates the FPS timer; should be called once, and ONLY once per frame.

Definition at line 18 of file ctimer.cpp.

References CSingletonManager< CTimerSystem >::get_instance(), CTimerSystem::get_ticks(), and CModel::notify().

Here is the call graph for this function:


The documentation for this class was generated from the following files:
Generated on Wed Aug 27 11:58:52 2003 for GFW by doxygen 1.3.3