#ifndef SPECTRE_GAME_TIME_H #define SPECTRE_GAME_TIME_H #include #include namespace sp { class GameTime { public : GameTime(unsigned long updates_per_sec = 60); void setTimeStep(unsigned long updates_per_sec); double getTimeStep() const; Time getElapsed() const; //bool shouldTick(); bool beginFrame(); bool tick(); void reset(); protected : void accumulateTime(); void updateTime(); protected : // TODO: min,max framerates Stopwatch m_watch; Time m_acc; // Timeslice. Time m_slice; }; } // namespace sp #endif /* SPECTRE_GAME_TIME_H */