diff --git a/sources/Component/Drawable/Drawable2DComponent.hpp b/sources/Component/Drawable/Drawable2DComponent.hpp index e9a031f3..cefb2c62 100644 --- a/sources/Component/Drawable/Drawable2DComponent.hpp +++ b/sources/Component/Drawable/Drawable2DComponent.hpp @@ -10,10 +10,9 @@ namespace BBM { template - class Drawable2DComponent : public WAL::Component + class Drawable2DComponent : public WAL::Component, public T { public: - T member; explicit Drawable2DComponent(WAL::Entity &entity) : WAL::Component(entity) @@ -24,5 +23,7 @@ namespace BBM { return new Drawable2DComponent(entity); } + + }; } \ No newline at end of file diff --git a/sources/System/Renderer/Renderer2DSystem.hpp b/sources/System/Renderer/Renderer2DSystem.hpp index 187996bd..69e94e96 100644 --- a/sources/System/Renderer/Renderer2DSystem.hpp +++ b/sources/System/Renderer/Renderer2DSystem.hpp @@ -32,10 +32,10 @@ namespace BBM auto &pos = entity.getComponent(); comp.setPosition({pos.getX(), pos.getY()}); - comp.member.drawOn(this->_window); + comp.drawOn(this->_window); } - Renderer2DSystem(const Renderer3DSystem &) = default; + Renderer2DSystem(const Renderer2DSystem &) = default; ~Renderer2DSystem() override = default; Renderer2DSystem &operator=(const Renderer2DSystem &) = delete; }; diff --git a/sources/System/Renderer/Renderer3DSystem.hpp b/sources/System/Renderer/Renderer3DSystem.hpp index ce7ba279..83e91ff3 100644 --- a/sources/System/Renderer/Renderer3DSystem.hpp +++ b/sources/System/Renderer/Renderer3DSystem.hpp @@ -31,7 +31,7 @@ namespace BBM auto &comp = entity.getComponent>(); auto &pos = entity.getComponent(); - comp.setPosition(pos); + comp.member.setPosition(pos); comp.member.drawOn(this->_window); } diff --git a/sources/main.cpp b/sources/main.cpp index f4768227..5429c90e 100644 --- a/sources/main.cpp +++ b/sources/main.cpp @@ -12,6 +12,7 @@ #include "Drawables/2D/Text.hpp" #include "Drawables/3D/Grid.hpp" #include "Drawables/Texture.hpp" +#include "Drawables/2D/Circle.hpp" #include "Model/Model.hpp" #include "Model/ModelAnimations.hpp" #include "System/Renderer/Renderer2DSystem.hpp"