diff --git a/src/scene_manager.h b/src/scene_manager.h index b18c4d7..5e62982 100644 --- a/src/scene_manager.h +++ b/src/scene_manager.h @@ -26,14 +26,30 @@ public: void UpdateActiveScene() { if (activeScene != entt::null) { + // Iterate over entities in the active scene that have an InputComponent + auto view = registry.view(); + for (auto entity : view) { + auto& inputComponent = view.get(entity); + inputComponent.Update(); // This will call the input logic + } } } void RenderActiveScene() { if (activeScene != entt::null) { + // Iterate over entities in the active scene that have both SpriteComponent and TransformComponent + auto view = registry.view(); + for (auto entity : view) { + auto& sprite = view.get(entity); + auto& transform = view.get(entity); + + // Render the sprite at the position defined by the TransformComponent + sprite.Render(transform); + } } } + private: entt::registry& registry; entt::entity activeScene;