Spectre/Game/FPSCounter: Use sp::Time
This commit is contained in:
parent
6de6028ba4
commit
919aa7740a
2 changed files with 19 additions and 18 deletions
|
|
@ -2,6 +2,8 @@
|
|||
#ifndef SPECTRE_FPS_COUNTER_H
|
||||
#define SPECTRE_FPS_COUNTER_H
|
||||
|
||||
#include <Spectre/Math/Time.h>
|
||||
|
||||
// Simple FPS counter.
|
||||
|
||||
namespace sp {
|
||||
|
|
@ -19,7 +21,7 @@ public :
|
|||
|
||||
// Set the update rate (in seconds).
|
||||
// How often the FPS should be sampled and calculated.
|
||||
void setUpdateRate(unsigned int seconds);
|
||||
void setUpdateRate(unsigned int rate);
|
||||
|
||||
// Update the internal time measurment.
|
||||
bool update();
|
||||
|
|
@ -29,16 +31,16 @@ public :
|
|||
|
||||
private :
|
||||
|
||||
// Frame counter.
|
||||
// Number of frames since last update.
|
||||
unsigned int m_count;
|
||||
|
||||
// time (in ms)
|
||||
unsigned int m_time;
|
||||
// Last time we updated the counter.
|
||||
Time m_time;
|
||||
|
||||
// Update rate (in ms)
|
||||
unsigned int m_updateRate;
|
||||
// Update rate (at what interval should we update)
|
||||
Time m_updateRate;
|
||||
|
||||
// Calculated fps.
|
||||
// Calculated Frames per second.
|
||||
float m_fps;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue