Made Background::Draw receive const scene pointer

Former-commit-id: 2b84f8ea924714d81046f3dd29990939586e7622
This commit is contained in:
Lynix 2013-04-03 01:47:43 +02:00
parent 2c7744af41
commit 98e70f21a1
6 changed files with 12 additions and 6 deletions

View File

@ -10,13 +10,15 @@
#include <Nazara/Prerequesites.hpp>
#include <Nazara/Graphics/Enums.hpp>
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;
};

View File

@ -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;

View File

@ -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;

View File

@ -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);
}

View File

@ -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;

View File

@ -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();