Renamed Background to AbstractBackground
Former-commit-id: c99ed2e48c4d82fb1100f412a85468c698142815
This commit is contained in:
parent
308c2cfd78
commit
1a6e55881b
|
|
@ -29,9 +29,9 @@
|
||||||
#ifndef NAZARA_GLOBAL_GRAPHICS_HPP
|
#ifndef NAZARA_GLOBAL_GRAPHICS_HPP
|
||||||
#define NAZARA_GLOBAL_GRAPHICS_HPP
|
#define NAZARA_GLOBAL_GRAPHICS_HPP
|
||||||
|
|
||||||
|
#include <Nazara/Graphics/AbstractBackground.hpp>
|
||||||
#include <Nazara/Graphics/AbstractRenderQueue.hpp>
|
#include <Nazara/Graphics/AbstractRenderQueue.hpp>
|
||||||
#include <Nazara/Graphics/AbstractRenderTechnique.hpp>
|
#include <Nazara/Graphics/AbstractRenderTechnique.hpp>
|
||||||
#include <Nazara/Graphics/Background.hpp>
|
|
||||||
#include <Nazara/Graphics/Camera.hpp>
|
#include <Nazara/Graphics/Camera.hpp>
|
||||||
#include <Nazara/Graphics/ColorBackground.hpp>
|
#include <Nazara/Graphics/ColorBackground.hpp>
|
||||||
#include <Nazara/Graphics/Config.hpp>
|
#include <Nazara/Graphics/Config.hpp>
|
||||||
|
|
|
||||||
|
|
@ -4,23 +4,23 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#ifndef NAZARA_BACKGROUND_HPP
|
#ifndef NAZARA_ABSTRACTBACKGROUND_HPP
|
||||||
#define NAZARA_BACKGROUND_HPP
|
#define NAZARA_ABSTRACTBACKGROUND_HPP
|
||||||
|
|
||||||
#include <Nazara/Prerequesites.hpp>
|
#include <Nazara/Prerequesites.hpp>
|
||||||
#include <Nazara/Graphics/Enums.hpp>
|
#include <Nazara/Graphics/Enums.hpp>
|
||||||
|
|
||||||
class NzScene;
|
class NzScene;
|
||||||
|
|
||||||
class NAZARA_API NzBackground
|
class NAZARA_API NzAbstractBackground
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NzBackground() = default;
|
NzAbstractBackground() = default;
|
||||||
virtual ~NzBackground();
|
virtual ~NzAbstractBackground();
|
||||||
|
|
||||||
virtual void Draw(const NzScene* scene) const = 0;
|
virtual void Draw(const NzScene* scene) const = 0;
|
||||||
|
|
||||||
virtual nzBackgroundType GetBackgroundType() const = 0;
|
virtual nzBackgroundType GetBackgroundType() const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // NAZARA_BACKGROUND_HPP
|
#endif // NAZARA_ABSTRACTBACKGROUND_HPP
|
||||||
|
|
@ -9,9 +9,9 @@
|
||||||
|
|
||||||
#include <Nazara/Prerequesites.hpp>
|
#include <Nazara/Prerequesites.hpp>
|
||||||
#include <Nazara/Core/Color.hpp>
|
#include <Nazara/Core/Color.hpp>
|
||||||
#include <Nazara/Graphics/Background.hpp>
|
#include <Nazara/Graphics/AbstractBackground.hpp>
|
||||||
|
|
||||||
class NAZARA_API NzColorBackground : public NzBackground
|
class NAZARA_API NzColorBackground : public NzAbstractBackground
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NzColorBackground(const NzColor& color = NzColor::Black);
|
NzColorBackground(const NzColor& color = NzColor::Black);
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,8 @@
|
||||||
#include <Nazara/Prerequesites.hpp>
|
#include <Nazara/Prerequesites.hpp>
|
||||||
#include <Nazara/Core/Color.hpp>
|
#include <Nazara/Core/Color.hpp>
|
||||||
#include <Nazara/Core/Updatable.hpp>
|
#include <Nazara/Core/Updatable.hpp>
|
||||||
|
#include <Nazara/Graphics/AbstractBackground.hpp>
|
||||||
#include <Nazara/Graphics/AbstractRenderTechnique.hpp>
|
#include <Nazara/Graphics/AbstractRenderTechnique.hpp>
|
||||||
#include <Nazara/Graphics/Background.hpp>
|
|
||||||
#include <Nazara/Math/Frustum.hpp>
|
#include <Nazara/Math/Frustum.hpp>
|
||||||
|
|
||||||
class NzAbstractRenderQueue;
|
class NzAbstractRenderQueue;
|
||||||
|
|
@ -38,7 +38,7 @@ class NAZARA_API NzScene
|
||||||
|
|
||||||
NzCamera* GetActiveCamera() const;
|
NzCamera* GetActiveCamera() const;
|
||||||
NzColor GetAmbientColor() const;
|
NzColor GetAmbientColor() const;
|
||||||
NzBackground* GetBackground() const;
|
NzAbstractBackground* GetBackground() const;
|
||||||
NzAbstractRenderTechnique* GetRenderTechnique() const;
|
NzAbstractRenderTechnique* GetRenderTechnique() const;
|
||||||
NzSceneNode& GetRoot() const;
|
NzSceneNode& GetRoot() const;
|
||||||
float GetUpdateTime() const;
|
float GetUpdateTime() const;
|
||||||
|
|
@ -47,7 +47,7 @@ class NAZARA_API NzScene
|
||||||
void RegisterForUpdate(NzUpdatable* object);
|
void RegisterForUpdate(NzUpdatable* object);
|
||||||
|
|
||||||
void SetAmbientColor(const NzColor& color);
|
void SetAmbientColor(const NzColor& color);
|
||||||
void SetBackground(NzBackground* background);
|
void SetBackground(NzAbstractBackground* background);
|
||||||
void SetRenderTechnique(NzAbstractRenderTechnique* renderTechnique);
|
void SetRenderTechnique(NzAbstractRenderTechnique* renderTechnique);
|
||||||
void SetUpdatePerSecond(unsigned int updatePerSecond);
|
void SetUpdatePerSecond(unsigned int updatePerSecond);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,14 +8,14 @@
|
||||||
#define NAZARA_SKYBOXBACKGROUND_HPP
|
#define NAZARA_SKYBOXBACKGROUND_HPP
|
||||||
|
|
||||||
#include <Nazara/Prerequesites.hpp>
|
#include <Nazara/Prerequesites.hpp>
|
||||||
#include <Nazara/Graphics/Background.hpp>
|
#include <Nazara/Graphics/AbstractBackground.hpp>
|
||||||
#include <Nazara/Renderer/Shader.hpp>
|
#include <Nazara/Renderer/Shader.hpp>
|
||||||
#include <Nazara/Renderer/Texture.hpp>
|
#include <Nazara/Renderer/Texture.hpp>
|
||||||
#include <Nazara/Renderer/TextureSampler.hpp>
|
#include <Nazara/Renderer/TextureSampler.hpp>
|
||||||
#include <Nazara/Utility/IndexBuffer.hpp>
|
#include <Nazara/Utility/IndexBuffer.hpp>
|
||||||
#include <Nazara/Utility/VertexBuffer.hpp>
|
#include <Nazara/Utility/VertexBuffer.hpp>
|
||||||
|
|
||||||
class NAZARA_API NzSkyboxBackground : public NzBackground
|
class NAZARA_API NzSkyboxBackground : public NzAbstractBackground
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
NzSkyboxBackground();
|
NzSkyboxBackground();
|
||||||
|
|
|
||||||
|
|
@ -8,13 +8,16 @@
|
||||||
#define NAZARA_TEXTUREBACKGROUND_HPP
|
#define NAZARA_TEXTUREBACKGROUND_HPP
|
||||||
|
|
||||||
#include <Nazara/Prerequesites.hpp>
|
#include <Nazara/Prerequesites.hpp>
|
||||||
#include <Nazara/Graphics/Background.hpp>
|
#include <Nazara/Graphics/AbstractBackground.hpp>
|
||||||
|
#include <Nazara/Renderer/Shader.hpp>
|
||||||
#include <Nazara/Renderer/Texture.hpp>
|
#include <Nazara/Renderer/Texture.hpp>
|
||||||
|
|
||||||
class NAZARA_API NzTextureBackground : public NzBackground
|
class NAZARA_API NzTextureBackground : public NzAbstractBackground
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
NzTextureBackground();
|
||||||
NzTextureBackground(NzTexture* texture);
|
NzTextureBackground(NzTexture* texture);
|
||||||
|
~NzTextureBackground();
|
||||||
|
|
||||||
void Draw(const NzScene* scene) const;
|
void Draw(const NzScene* scene) const;
|
||||||
|
|
||||||
|
|
@ -24,6 +27,7 @@ class NAZARA_API NzTextureBackground : public NzBackground
|
||||||
void SetTexture(NzTexture* texture);
|
void SetTexture(NzTexture* texture);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
NzShaderRef m_shader;
|
||||||
NzTextureRef m_texture;
|
NzTextureRef m_texture;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
// This file is part of the "Nazara Engine - Graphics module"
|
// This file is part of the "Nazara Engine - Graphics module"
|
||||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
#include <Nazara/Graphics/Background.hpp>
|
#include <Nazara/Graphics/AbstractBackground.hpp>
|
||||||
#include <Nazara/Graphics/Debug.hpp>
|
#include <Nazara/Graphics/Debug.hpp>
|
||||||
|
|
||||||
NzBackground::~NzBackground() = default;
|
NzAbstractBackground::~NzAbstractBackground() = default;
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||||
|
|
||||||
#include <Nazara/Graphics/ForwardRenderTechnique.hpp>
|
#include <Nazara/Graphics/ForwardRenderTechnique.hpp>
|
||||||
#include <Nazara/Graphics/Background.hpp>
|
#include <Nazara/Graphics/AbstractBackground.hpp>
|
||||||
#include <Nazara/Graphics/Camera.hpp>
|
#include <Nazara/Graphics/Camera.hpp>
|
||||||
#include <Nazara/Graphics/Drawable.hpp>
|
#include <Nazara/Graphics/Drawable.hpp>
|
||||||
#include <Nazara/Graphics/Light.hpp>
|
#include <Nazara/Graphics/Light.hpp>
|
||||||
|
|
@ -38,7 +38,7 @@ void NzForwardRenderTechnique::Clear(const NzScene* scene)
|
||||||
NzRenderer::Enable(nzRendererParameter_DepthWrite, true);
|
NzRenderer::Enable(nzRendererParameter_DepthWrite, true);
|
||||||
NzRenderer::Clear(nzRendererClear_Depth);
|
NzRenderer::Clear(nzRendererClear_Depth);
|
||||||
|
|
||||||
NzBackground* background = scene->GetBackground();
|
NzAbstractBackground* background = scene->GetBackground();
|
||||||
if (background)
|
if (background)
|
||||||
background->Draw(scene);
|
background->Draw(scene);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,8 +23,8 @@ struct NzSceneImpl
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::unique_ptr<NzAbstractBackground> background;
|
||||||
std::unique_ptr<NzAbstractRenderTechnique> renderTechnique;
|
std::unique_ptr<NzAbstractRenderTechnique> renderTechnique;
|
||||||
std::unique_ptr<NzBackground> background;
|
|
||||||
std::vector<NzUpdatable*> updateList;
|
std::vector<NzUpdatable*> updateList;
|
||||||
std::vector<NzUpdatable*> visibleUpdateList;
|
std::vector<NzUpdatable*> visibleUpdateList;
|
||||||
NzClock updateClock;
|
NzClock updateClock;
|
||||||
|
|
@ -92,7 +92,7 @@ NzColor NzScene::GetAmbientColor() const
|
||||||
return m_impl->ambientColor;
|
return m_impl->ambientColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
NzBackground* NzScene::GetBackground() const
|
NzAbstractBackground* NzScene::GetBackground() const
|
||||||
{
|
{
|
||||||
return m_impl->background.get();
|
return m_impl->background.get();
|
||||||
}
|
}
|
||||||
|
|
@ -135,7 +135,7 @@ void NzScene::SetAmbientColor(const NzColor& color)
|
||||||
m_impl->ambientColor = color;
|
m_impl->ambientColor = color;
|
||||||
}
|
}
|
||||||
|
|
||||||
void NzScene::SetBackground(NzBackground* background)
|
void NzScene::SetBackground(NzAbstractBackground* background)
|
||||||
{
|
{
|
||||||
m_impl->background.reset(background);
|
m_impl->background.reset(background);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue