diff --git a/include/Nazara/Graphics/Background.hpp b/include/Nazara/Graphics/Background.hpp index f8ba7d58a..4f32e4b36 100644 --- a/include/Nazara/Graphics/Background.hpp +++ b/include/Nazara/Graphics/Background.hpp @@ -10,13 +10,15 @@ #include #include +class NzScene; + class NAZARA_API NzBackground { public: NzBackground() = default; ~NzBackground(); - virtual void Draw() const = 0; + virtual void Draw(const NzScene* scene) const = 0; virtual nzBackgroundType GetBackgroundType() const = 0; }; diff --git a/include/Nazara/Graphics/ColorBackground.hpp b/include/Nazara/Graphics/ColorBackground.hpp index c51a158eb..049157a08 100644 --- a/include/Nazara/Graphics/ColorBackground.hpp +++ b/include/Nazara/Graphics/ColorBackground.hpp @@ -16,7 +16,7 @@ class NAZARA_API NzColorBackground : public NzBackground public: NzColorBackground(const NzColor& color = NzColor::Black); - void Draw() const; + void Draw(const NzScene* scene) const; nzBackgroundType GetBackgroundType() const; NzColor GetColor() const; diff --git a/include/Nazara/Graphics/TextureBackground.hpp b/include/Nazara/Graphics/TextureBackground.hpp index 008abca36..58a458665 100644 --- a/include/Nazara/Graphics/TextureBackground.hpp +++ b/include/Nazara/Graphics/TextureBackground.hpp @@ -16,7 +16,7 @@ class NAZARA_API NzTextureBackground : public NzBackground public: NzTextureBackground(NzTexture* texture); - void Draw() const; + void Draw(const NzScene* scene) const; nzBackgroundType GetBackgroundType() const; NzTexture* GetTexture() const; diff --git a/src/Nazara/Graphics/ColorBackground.cpp b/src/Nazara/Graphics/ColorBackground.cpp index eda8eb2ce..bdcc5b760 100644 --- a/src/Nazara/Graphics/ColorBackground.cpp +++ b/src/Nazara/Graphics/ColorBackground.cpp @@ -11,8 +11,10 @@ m_color(color) { } -void NzColorBackground::Draw() const +void NzColorBackground::Draw(const NzScene* scene) const { + NazaraUnused(scene); + NzRenderer::SetClearColor(m_color); NzRenderer::Clear(nzRendererClear_Color); } diff --git a/src/Nazara/Graphics/Scene.cpp b/src/Nazara/Graphics/Scene.cpp index 9a0948e5e..4b3f8d551 100644 --- a/src/Nazara/Graphics/Scene.cpp +++ b/src/Nazara/Graphics/Scene.cpp @@ -108,7 +108,7 @@ void NzScene::Draw() NzRenderer::Clear(nzRendererClear_Depth); if (m_impl->background) - m_impl->background->Draw(); + m_impl->background->Draw(this); LightComparator lightComparator; diff --git a/src/Nazara/Graphics/TextureBackground.cpp b/src/Nazara/Graphics/TextureBackground.cpp index ef8ad7141..a5fd2dc5d 100644 --- a/src/Nazara/Graphics/TextureBackground.cpp +++ b/src/Nazara/Graphics/TextureBackground.cpp @@ -12,8 +12,10 @@ m_texture(texture) { } -void NzTextureBackground::Draw() const +void NzTextureBackground::Draw(const NzScene* scene) const { + NazaraUnused(scene); + const NzRenderTarget* target = NzRenderer::GetTarget(); NzRectui viewport = NzRenderer::GetViewport();