Added Scene::EnableBackground
Former-commit-id: 57a3c3e41799703bb72b4980433d7faadc3b1b86
This commit is contained in:
parent
8aaed03310
commit
012c120bf1
|
|
@ -37,6 +37,8 @@ class NAZARA_API NzScene
|
|||
void Cull();
|
||||
void Draw();
|
||||
|
||||
void EnableBackground(bool enable);
|
||||
|
||||
NzColor GetAmbientColor() const;
|
||||
NzAbstractBackground* GetBackground() const;
|
||||
NzAbstractRenderTechnique* GetRenderTechnique() const;
|
||||
|
|
@ -45,6 +47,8 @@ class NAZARA_API NzScene
|
|||
float GetUpdateTime() const;
|
||||
unsigned int GetUpdatePerSecond() const;
|
||||
|
||||
bool IsBackgroundEnabled() const;
|
||||
|
||||
void RegisterForUpdate(NzUpdatable* object);
|
||||
|
||||
void SetAmbientColor(const NzColor& color);
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ bool NzDeferredForwardPass::Process(const NzScene* scene, unsigned int workTextu
|
|||
NzRenderer::SetTarget(m_workRTT);
|
||||
NzRenderer::SetViewport(NzRecti(0, 0, m_dimensions.x, m_dimensions.y));
|
||||
|
||||
NzAbstractBackground* background = scene->GetBackground();
|
||||
NzAbstractBackground* background = (scene->IsBackgroundEnabled()) ? scene->GetBackground() : nullptr;
|
||||
if (background)
|
||||
background->Draw(scene);
|
||||
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ void NzForwardRenderTechnique::Clear(const NzScene* scene) const
|
|||
NzRenderer::Enable(nzRendererParameter_DepthWrite, true);
|
||||
NzRenderer::Clear(nzRendererBuffer_Depth);
|
||||
|
||||
NzAbstractBackground* background = scene->GetBackground();
|
||||
NzAbstractBackground* background = (scene->IsBackgroundEnabled()) ? scene->GetBackground() : nullptr;
|
||||
if (background)
|
||||
background->Draw(scene);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue