deltatime

This commit is contained in:
2026-03-12 21:23:31 +01:00
parent 74159a6fda
commit 4c07694a25
7 changed files with 28 additions and 13 deletions

View File

@@ -11,6 +11,6 @@ namespace Game::AGame {
public:
~Player() override = default;
void start() override;
void update() override;
void update(float deltaTime) override;
};
}

View File

@@ -9,6 +9,8 @@
#include <functional>
namespace Game {
using clock = std::chrono::steady_clock;
class GameManager {
public:
GameManager() { LOG("Created GameManager"); };
@@ -21,5 +23,6 @@ namespace Game {
int getTargetUpdatesPerSecond() { return mTargetUpdatesPerSecond; }
private:
int mTargetUpdatesPerSecond = 60;
clock::time_point mLastUpdate;
};
}

View File

@@ -25,7 +25,7 @@ namespace Game::Object {
virtual ~Entity() = 0;
virtual void start() = 0;
virtual void update() = 0;
virtual void update(float deltaTime) = 0;
void render(Game::Renderer::Renderer* renderer);
// Setters and getters