diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-11-14 11:26:12 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-11-14 11:26:12 +0100 |
commit | 01c09a196c3f3e5cefaa4119a95a1cdeb7b9c263 (patch) | |
tree | 5667369a85bd06b683c67de42bf0311c2647912b /src/crepe/api/LoopManager.cpp | |
parent | 6e13510f3c6d4155707f748d237bb1fa05243450 (diff) | |
parent | 8600b8a29351aae26ec7b22f84aeeef92d8cb421 (diff) |
merge `loek/cleanup` into `loek/audio`
Diffstat (limited to 'src/crepe/api/LoopManager.cpp')
-rw-r--r-- | src/crepe/api/LoopManager.cpp | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/src/crepe/api/LoopManager.cpp b/src/crepe/api/LoopManager.cpp index 2e9823f..f0788ab 100644 --- a/src/crepe/api/LoopManager.cpp +++ b/src/crepe/api/LoopManager.cpp @@ -1,5 +1,9 @@ - #include "../facade/SDLContext.h" + +#include "../system/AnimatorSystem.h" +#include "../system/CollisionSystem.h" +#include "../system/ParticleSystem.h" +#include "../system/PhysicsSystem.h" #include "../system/RenderSystem.h" #include "../system/ScriptSystem.h" @@ -7,11 +11,25 @@ #include "LoopTimer.h" using namespace crepe; +using namespace std; + +LoopManager::LoopManager() { + this->load_system<AnimatorSystem>(); + this->load_system<CollisionSystem>(); + this->load_system<ParticleSystem>(); + this->load_system<PhysicsSystem>(); + this->load_system<RenderSystem>(); + this->load_system<ScriptSystem>(); +} + +ComponentManager & LoopManager::get_component_manager() { + return this->component_manager; +} -LoopManager::LoopManager() {} void LoopManager::process_input() { SDLContext::get_instance().handle_events(this->game_running); } + void LoopManager::start() { this->setup(); this->loop(); @@ -48,7 +66,7 @@ void LoopManager::setup() { void LoopManager::render() { if (this->game_running) { - RenderSystem::get_instance().update(); + this->get_system<RenderSystem>().update(); } } |