Made Background::Draw receive const scene pointer
Former-commit-id: 2b84f8ea924714d81046f3dd29990939586e7622
This commit is contained in:
parent
2c7744af41
commit
98e70f21a1
|
|
@ -10,13 +10,15 @@
|
||||||
#include <Nazara/Prerequesites.hpp>
|
#include <Nazara/Prerequesites.hpp>
|
||||||
#include <Nazara/Graphics/Enums.hpp>
|
#include <Nazara/Graphics/Enums.hpp>
|
||||||
|
|
||||||
|
class NzScene;
|
||||||
|
|
||||||
class NAZARA_API NzBackground
|
class NAZARA_API NzBackground
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NzBackground() = default;
|
NzBackground() = default;
|
||||||
~NzBackground();
|
~NzBackground();
|
||||||
|
|
||||||
virtual void Draw() const = 0;
|
virtual void Draw(const NzScene* scene) const = 0;
|
||||||
|
|
||||||
virtual nzBackgroundType GetBackgroundType() const = 0;
|
virtual nzBackgroundType GetBackgroundType() const = 0;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ class NAZARA_API NzColorBackground : public NzBackground
|
||||||
public:
|
public:
|
||||||
NzColorBackground(const NzColor& color = NzColor::Black);
|
NzColorBackground(const NzColor& color = NzColor::Black);
|
||||||
|
|
||||||
void Draw() const;
|
void Draw(const NzScene* scene) const;
|
||||||
|
|
||||||
nzBackgroundType GetBackgroundType() const;
|
nzBackgroundType GetBackgroundType() const;
|
||||||
NzColor GetColor() const;
|
NzColor GetColor() const;
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ class NAZARA_API NzTextureBackground : public NzBackground
|
||||||
public:
|
public:
|
||||||
NzTextureBackground(NzTexture* texture);
|
NzTextureBackground(NzTexture* texture);
|
||||||
|
|
||||||
void Draw() const;
|
void Draw(const NzScene* scene) const;
|
||||||
|
|
||||||
nzBackgroundType GetBackgroundType() const;
|
nzBackgroundType GetBackgroundType() const;
|
||||||
NzTexture* GetTexture() const;
|
NzTexture* GetTexture() const;
|
||||||
|
|
|
||||||
|
|
@ -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::SetClearColor(m_color);
|
||||||
NzRenderer::Clear(nzRendererClear_Color);
|
NzRenderer::Clear(nzRendererClear_Color);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -108,7 +108,7 @@ void NzScene::Draw()
|
||||||
NzRenderer::Clear(nzRendererClear_Depth);
|
NzRenderer::Clear(nzRendererClear_Depth);
|
||||||
|
|
||||||
if (m_impl->background)
|
if (m_impl->background)
|
||||||
m_impl->background->Draw();
|
m_impl->background->Draw(this);
|
||||||
|
|
||||||
LightComparator lightComparator;
|
LightComparator lightComparator;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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();
|
const NzRenderTarget* target = NzRenderer::GetTarget();
|
||||||
NzRectui viewport = NzRenderer::GetViewport();
|
NzRectui viewport = NzRenderer::GetViewport();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue