FrameRate Class Reference
#include <FrameRate.h>
![](../class_frame_rate.png)
# 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 | |
![]() | |
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) |
![]() | |
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()
The next game frame cycle has started.
- Parameters
-
gameCycleEnded Flag that indicates if the previous game frame was completed before the current second has elapsed printFPS True to print the FPS during the previous second
Definition at line 69 of file FrameRate.c.
# print()
Print the frames per second statistics.
- Parameters
-
x Screen x coordinate where to print y Screen 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
-
targetFPS Target 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
|
protected |
Current frames per second.
Definition at line 42 of file FrameRate.h.
# gameFrameStarts
|
protected |
Total number of game frame starts.
Definition at line 45 of file FrameRate.h.
# seconds
|
protected |
Accumualted elapssed seconds.
Definition at line 39 of file FrameRate.h.
# targetFPS
|
protected |
The target frames per second.
Definition at line 51 of file FrameRate.h.
# totalFPS
|
protected |
Accumulated frames per second.
Definition at line 33 of file FrameRate.h.
# totalUnevenFPS
|
protected |
Accumulated uneven frames per second.
Definition at line 36 of file FrameRate.h.
# 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:
- VUEngine-Core/source/Misc/FrameRate/FrameRate.h
- VUEngine-Core/source/Misc/FrameRate/FrameRate.c