Nazara Engine  0.4
A fast, complete, cross-platform API designed for game development
ColorBackground.hpp
1 // Copyright (C) 2017 Jérôme Leclercq
2 // This file is part of the "Nazara Engine - Graphics module"
3 // For conditions of distribution and use, see copyright notice in Config.hpp
4 
5 #pragma once
6 
7 #ifndef NAZARA_COLORBACKGROUND_HPP
8 #define NAZARA_COLORBACKGROUND_HPP
9 
10 #include <Nazara/Prerequesites.hpp>
11 #include <Nazara/Core/Color.hpp>
12 #include <Nazara/Graphics/AbstractBackground.hpp>
13 #include <Nazara/Renderer/UberShader.hpp>
14 
15 namespace Nz
16 {
17  class ColorBackground;
18 
19  using ColorBackgroundConstRef = ObjectRef<const ColorBackground>;
20  using ColorBackgroundRef = ObjectRef<ColorBackground>;
21 
22  class NAZARA_GRAPHICS_API ColorBackground : public AbstractBackground
23  {
24  public:
25  ColorBackground(const Color& color = Color::Black);
26  ColorBackground(const ColorBackground&) = default;
27  ColorBackground(ColorBackground&&) = delete;
28 
29  void Draw(const AbstractViewer* viewer) const override;
30 
31  BackgroundType GetBackgroundType() const override;
32  Color GetColor() const;
33 
34  void SetColor(const Color& color);
35 
36  ColorBackground& operator=(ColorBackground&&) = delete;
37 
38  template<typename... Args> static ColorBackgroundRef New(Args&&... args);
39 
40  private:
41  Color m_color;
42  UberShaderConstRef m_uberShader;
43  const UberShaderInstance* m_uberShaderInstance;
44  int m_materialDiffuseUniform;
45  int m_vertexDepthUniform;
46  };
47 }
48 
49 #include <Nazara/Graphics/ColorBackground.inl>
50 
51 #endif // NAZARA_COLORBACKGROUND_HPP
Core class that represents a color.
Definition: Color.hpp:18
TODO: Inherit SoundEmitter from Node.
Definition: Algorithm.hpp:12
Graphics class that represents the viewer for our scene.
Definition: AbstractViewer.hpp:21
Graphics class that represents a background with uniform color.
Definition: ColorBackground.hpp:22
Core class that represents a reference to an object.
Definition: ObjectRef.hpp:18
Graphics class that represents the background for our scene.
Definition: AbstractBackground.hpp:25