aboutsummaryrefslogtreecommitdiff
path: root/gameloop/include/timer.h
diff options
context:
space:
mode:
Diffstat (limited to 'gameloop/include/timer.h')
-rw-r--r--gameloop/include/timer.h29
1 files changed, 14 insertions, 15 deletions
diff --git a/gameloop/include/timer.h b/gameloop/include/timer.h
index 2769e4d..a245e5c 100644
--- a/gameloop/include/timer.h
+++ b/gameloop/include/timer.h
@@ -7,25 +7,24 @@ public:
static LoopTimer& getInstance();
void start();
void update();
- float getDeltaTime() const;
- float getDeltaTimeMs() const;
- float getFixedDeltaTime() const;
+ double getDeltaTime() const;
int getCurrentTime() const;
+ void advanceFixedUpdate();
+ double getFixedDeltaTime() const;
void setFPS(int FPS);
int getFPS() const;
void enforceFrameRate();
- float getLag() const;
+ double getLag() const;
private:
LoopTimer();
- int FPS = 30;
- float frameTargetTime = FPS / 1000;
- int lastTime;
- float fixedDeltaTime = 2;
- float maxDeltaTime = 1;
- float fixedTime = 0;
- int lastFrameTime;
- float deltaTime;
- float time = 0;
- int frequency;
- float lag;
+ int FPS = 50;
+ double gameScale = 1;
+ double maximumDeltaTime = 0.25;
+ double deltaTime;
+ double frameTargetTime = FPS / 1000;
+ double fixedDeltaTime = 0.01;
+ double elapsedTime;
+ double elapsedFixedTime;
+ double time;
+ uint64_t lastFrameTime;
};