diff options
author | WBoerenkamps <wrj.boerenkamps@student.avans.nl> | 2024-11-11 18:09:39 +0100 |
---|---|---|
committer | WBoerenkamps <wrj.boerenkamps@student.avans.nl> | 2024-11-11 18:09:39 +0100 |
commit | 30c1eeeb9f1ca5a643a30edb4e7010f8a60bdd30 (patch) | |
tree | 1e7e10be4e6ce47c713777e43e5da0f02ccd17e1 /src/crepe/api/LoopManager.cpp | |
parent | 68fa604568e6dafac383a88d252c125f97431567 (diff) |
code cleanup changes
Diffstat (limited to 'src/crepe/api/LoopManager.cpp')
-rw-r--r-- | src/crepe/api/LoopManager.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/crepe/api/LoopManager.cpp b/src/crepe/api/LoopManager.cpp index 5c79920..abf1f7e 100644 --- a/src/crepe/api/LoopManager.cpp +++ b/src/crepe/api/LoopManager.cpp @@ -7,7 +7,14 @@ #include "LoopTimer.h" namespace crepe { - +LoopManager::LoopManager(const RenderSystem& renderSystem, const SDLContext& sdlContext, + const LoopTimer& loopTimer, const ScriptSystem& scriptSystem, + const SoundSystem& soundSystem, const ParticleSystem& particleSystem, + const PhysicsSystem& physicsSystem, const AnimatorSystem& animatorSystem, + const CollisionSystem& collisionSystem) { + // Initialize systems if needed + // Example: this->renderSystem = renderSystem; +} void LoopManager::process_input() { SDLContext::get_instance().handle_events(this->game_running); } @@ -28,13 +35,13 @@ void LoopManager::loop() { timer.update(); while (timer.get_lag() >= timer.get_fixed_delta_time()) { - process_input(); - fixed_update(); + this->process_input(); + this->fixed_update(); timer.advance_fixed_update(); } - update(); - render(); + this->update(); + this->render(); timer.enforce_frame_rate(); } @@ -48,7 +55,7 @@ void LoopManager::setup() { } void LoopManager::render() { - if (game_running) { + if (this->game_running) { RenderSystem::get_instance().update(); } } |