diff --git a/include/Nazara/Graphics/Components/GraphicsComponent.hpp b/include/Nazara/Graphics/Components/GraphicsComponent.hpp index 10481cb9d..1b4a94b34 100644 --- a/include/Nazara/Graphics/Components/GraphicsComponent.hpp +++ b/include/Nazara/Graphics/Components/GraphicsComponent.hpp @@ -24,6 +24,7 @@ namespace Nz static constexpr std::size_t MaxRenderableCount = 8; inline GraphicsComponent(bool initiallyVisible = true); + inline GraphicsComponent(std::shared_ptr renderable, UInt32 renderMask = 0xFFFFFFFF, bool initiallyVisible = true); GraphicsComponent(const GraphicsComponent&) = default; GraphicsComponent(GraphicsComponent&&) = default; ~GraphicsComponent() = default; diff --git a/include/Nazara/Graphics/Components/GraphicsComponent.inl b/include/Nazara/Graphics/Components/GraphicsComponent.inl index ea130d259..06dab6400 100644 --- a/include/Nazara/Graphics/Components/GraphicsComponent.inl +++ b/include/Nazara/Graphics/Components/GraphicsComponent.inl @@ -12,6 +12,12 @@ namespace Nz { m_worldInstance = std::make_shared(); //< FIXME: Use pools } + + inline GraphicsComponent::GraphicsComponent(std::shared_ptr renderable, UInt32 renderMask, bool initiallyVisible) : + GraphicsComponent(initiallyVisible) + { + AttachRenderable(std::move(renderable), renderMask); + } inline void GraphicsComponent::AttachRenderable(std::shared_ptr renderable, UInt32 renderMask) {