FrameRate Class Reference

#include <FrameRate.h>

Inheritance diagram for FrameRate:
ListenerObject

# Public Member Functions

void reset ()
 Reset the state of the manager.
void setTarget (uint8 targetFPS)
void update ()
 Update the elapsed frames during the current second.
void gameFrameStarted (bool gameCycleEnded, bool printFPS)
void print (int32 x, int32 y)

# Protected Attributes

uint32 totalFPS
 Accumulated frames per second.
uint32 totalUnevenFPS
 Accumulated uneven frames per second.
uint16 seconds
 Accumualted elapssed seconds.
uint16 FPS
 Current frames per second.
uint16 gameFrameStarts
 Total number of game frame starts.
uint16 unevenFPS
 Uneven frames during the current second.
uint8 targetFPS
 The target frames per second.

# Additional Inherited Members

- Private Member Functions inherited from ListenerObject
void constructor ()
 Class' constructor.
void destructor ()
 Class' destructor.
void addEventListener (ListenerObject listener, uint16 eventCode)
void removeEventListener (ListenerObject listener, uint16 eventCode)
void removeEventListeners (uint16 eventCode)
void removeAllEventListeners ()
 Remove all listener objects.
bool hasActiveEventListeners ()
void fireEvent (uint16 eventCode)
void sendMessageTo (ListenerObject receiver, uint32 message, uint32 delay, uint32 randomDelay)
void sendMessageToSelf (uint32 message, uint32 delay, uint32 randomDelay)
void discardAllMessages ()
 Discard all messages, both to be sent and to be received.
void discardMessages (uint32 message)
virtual bool onEvent (ListenerObject eventFirer, uint16 eventCode)
virtual bool handleMessage (Telegram telegram)
- Private Attributes inherited from ListenerObject
VirtualList events
 List of registered events.
int8 eventFirings
 Counter that keeps track of the number of fired events to prevent race conditions in nested firings.

# Detailed Description

Class FrameRate

Inherits from ListenerObject

Keeps track of the program's frame rate.

Definition at line 28 of file FrameRate.h.

# Member Function Documentation

# gameFrameStarted()

void FrameRate::gameFrameStarted ( bool gameCycleEnded,
bool printFPS )

The next game frame cycle has started.

Parameters
gameCycleEndedFlag that indicates if the previous game frame was completed before the current second has elapsed
printFPSTrue to print the FPS during the previous second

Definition at line 69 of file FrameRate.c.

# print()

void FrameRate::print ( int32 x,
int32 y )

Print the frames per second statistics.

Parameters
xScreen x coordinate where to print
yScreen y coordinate where to print

Definition at line 110 of file FrameRate.c.

# reset()

void FrameRate::reset ( )

Reset the state of the manager.

Definition at line 38 of file FrameRate.c.

# setTarget()

void FrameRate::setTarget ( uint8 targetFPS)

Set the target frames per second.

Parameters
targetFPSTarget frames per second

Definition at line 50 of file FrameRate.c.

# update()

void FrameRate::update ( )

Update the elapsed frames during the current second.

Definition at line 62 of file FrameRate.c.

# Member Data Documentation

# FPS

uint16 FrameRate::FPS
protected

Current frames per second.

Definition at line 42 of file FrameRate.h.

# gameFrameStarts

uint16 FrameRate::gameFrameStarts
protected

Total number of game frame starts.

Definition at line 45 of file FrameRate.h.

# seconds

uint16 FrameRate::seconds
protected

Accumualted elapssed seconds.

Definition at line 39 of file FrameRate.h.

# targetFPS

uint8 FrameRate::targetFPS
protected

The target frames per second.

Definition at line 51 of file FrameRate.h.

# totalFPS

uint32 FrameRate::totalFPS
protected

Accumulated frames per second.

Definition at line 33 of file FrameRate.h.

# totalUnevenFPS

uint32 FrameRate::totalUnevenFPS
protected

Accumulated uneven frames per second.

Definition at line 36 of file FrameRate.h.

# unevenFPS

uint16 FrameRate::unevenFPS
protected

Uneven frames during the current second.

Definition at line 48 of file FrameRate.h.


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