Spectre/Game/GameTime: Use sp::Time and sp::Stopwatch
This commit is contained in:
parent
6ee1752735
commit
d49d91a294
2 changed files with 18 additions and 31 deletions
|
|
@ -2,6 +2,9 @@
|
|||
#ifndef SPECTRE_GAME_TIME_H
|
||||
#define SPECTRE_GAME_TIME_H
|
||||
|
||||
#include <Spectre/Math/Time.h>
|
||||
#include <Spectre/System/Stopwatch.h>
|
||||
|
||||
namespace sp {
|
||||
|
||||
class GameTime
|
||||
|
|
@ -13,7 +16,7 @@ public :
|
|||
|
||||
double getTimeStep() const;
|
||||
|
||||
unsigned long getElapsed() const;
|
||||
Time getElapsed() const;
|
||||
|
||||
//bool shouldTick();
|
||||
|
||||
|
|
@ -33,13 +36,12 @@ protected :
|
|||
|
||||
// TODO: min,max framerates
|
||||
|
||||
// Time(in ms) when the last update occured.
|
||||
unsigned long m_current;
|
||||
unsigned long m_lastUpdate;
|
||||
double m_acc;
|
||||
Stopwatch m_watch;
|
||||
|
||||
// timeslice in ms.
|
||||
double m_slice;
|
||||
Time m_acc;
|
||||
|
||||
// Timeslice.
|
||||
Time m_slice;
|
||||
|
||||
bool m_inLoop;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue