| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- #pragma once
- #include "oxygine-include.h"
- #include "core/Object.h"
- namespace oxygine
- {
- DECLARE_SMART(Clock, spClock);
- class Clock: public Object
- {
- public:
- Clock();
- ~Clock();
- timeMS getTime() const;
- int getPauseCounter() const;
- int getFixedStep() const;
- int getLastDT() const;
- timeMS getLastUpdateTime() const;
- float getMultiplier() const;
- void setFixedStep(float stepMS);
- void setMultiplier(float m);
- void pause();
- void resume();
- void resetPause();
- void update(timeMS globalTime = -1);
- timeMS doTick();
- std::string dump() const;
- private:
- int _counter;
- double _destTime;
- double _srcTime;
- float _multiplier;
- float _fixedStep;
- int _lastDT;
- timeMS _lastUpdateTime;
- };
- }
|