1
0
Fork 0

Initial commit

This commit is contained in:
Henrik Hautakoski 2015-12-22 17:43:51 +01:00
commit edfc5298e1
252 changed files with 93965 additions and 0 deletions

View file

@ -0,0 +1,43 @@
#ifndef SPECTRE_FPS_COUNTER_H
#define SPECTRE_FPS_COUNTER_H
// Simple FPS counter.
class FPSCounter
{
public :
FPSCounter();
// Add a frame to the counter.
// Should be called whenever a frame has been rendered.
void addFrame();
float getFPS() const;
// Set the update rate (in seconds).
// How often the FPS should be sampled and calculated.
void setUpdateRate(unsigned int seconds);
// Update the internal time measurment.
bool update();
// Reset the frame time
void reset();
private :
// Frame counter.
unsigned int m_count;
// time (in ms)
unsigned int m_time;
// Update rate (in ms)
unsigned int m_updateRate;
// Calculated fps.
float m_fps;
};
#endif /* SPECTRE_FPS_COUNTER_H */