xoreos
0.0.5
|
A class counting frames per second. More...
#include <fpscounter.h>
Public Member Functions | |
FPSCounter (size_t secs) | |
Average the FPS over that many seconds. More... | |
~FPSCounter () | |
uint32 | getFPS () const |
Get the current FPS value. More... | |
void | reset () |
Reset the counter. More... | |
void | finishedFrame () |
Signal a finished frame. More... | |
Private Member Functions | |
void | calculateFPS () |
Calculate the average FPS value. More... | |
Private Attributes | |
uint32 | _lastSampled |
The last time a finished frame was signaled. More... | |
size_t | _seconds |
Number of seconds over which to average the FPS. More... | |
size_t | _currentSecond |
Current second we measure. More... | |
bool | _hasFullSeconds |
Got all samples? More... | |
uint32 | _fps |
The current FPS value. More... | |
Common::ScopedArray< uint32 > | _frames |
All frame counters. More... | |
A class counting frames per second.
Definition at line 34 of file fpscounter.h.
Graphics::FPSCounter::FPSCounter | ( | size_t | secs | ) |
Average the FPS over that many seconds.
Definition at line 35 of file fpscounter.cpp.
References _frames, _seconds, reset(), and Common::ScopedPtrBase< T, Deallocator >::reset().
Graphics::FPSCounter::~FPSCounter | ( | ) |
Definition at line 43 of file fpscounter.cpp.
|
private |
Calculate the average FPS value.
Definition at line 91 of file fpscounter.cpp.
References _currentSecond, _fps, _frames, _hasFullSeconds, and _seconds.
Referenced by finishedFrame().
void Graphics::FPSCounter::finishedFrame | ( | ) |
Signal a finished frame.
Definition at line 63 of file fpscounter.cpp.
References _currentSecond, _frames, _hasFullSeconds, _lastSampled, _seconds, calculateFPS(), and EventMan.
uint32 Graphics::FPSCounter::getFPS | ( | ) | const |
void Graphics::FPSCounter::reset | ( | ) |
Reset the counter.
Definition at line 50 of file fpscounter.cpp.
References _currentSecond, _fps, _frames, _hasFullSeconds, _lastSampled, and _seconds.
Referenced by FPSCounter().
|
private |
Current second we measure.
Definition at line 53 of file fpscounter.h.
Referenced by calculateFPS(), finishedFrame(), and reset().
|
private |
The current FPS value.
Definition at line 57 of file fpscounter.h.
Referenced by calculateFPS(), getFPS(), and reset().
|
private |
All frame counters.
Definition at line 59 of file fpscounter.h.
Referenced by calculateFPS(), finishedFrame(), FPSCounter(), and reset().
|
private |
Got all samples?
Definition at line 55 of file fpscounter.h.
Referenced by calculateFPS(), finishedFrame(), and reset().
|
private |
The last time a finished frame was signaled.
Definition at line 50 of file fpscounter.h.
Referenced by finishedFrame(), and reset().
|
private |
Number of seconds over which to average the FPS.
Definition at line 52 of file fpscounter.h.
Referenced by calculateFPS(), finishedFrame(), FPSCounter(), and reset().