Nazara Engine  0.4
A fast, complete, cross-platform API designed for game development
SkyboxBackground.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_SKYBOXBACKGROUND_HPP
8 #define NAZARA_SKYBOXBACKGROUND_HPP
9 
10 #include <Nazara/Prerequesites.hpp>
11 #include <Nazara/Graphics/AbstractBackground.hpp>
12 #include <Nazara/Renderer/Texture.hpp>
13 #include <Nazara/Renderer/TextureSampler.hpp>
14 
15 namespace Nz
16 {
17  class AbstractViewer;
18  class SkyboxBackground;
19 
20  using SkyboxBackgroundConstRef = ObjectRef<const SkyboxBackground>;
21  using SkyboxBackgroundRef = ObjectRef<SkyboxBackground>;
22 
23  class NAZARA_GRAPHICS_API SkyboxBackground : public AbstractBackground
24  {
25  friend class Graphics;
26 
27  public:
28  SkyboxBackground(TextureRef cubemapTexture = TextureRef());
29  ~SkyboxBackground() = default;
30 
31  void Draw(const AbstractViewer* viewer) const override;
32 
33  BackgroundType GetBackgroundType() const override;
34  inline const Vector3f& GetMovementOffset() const;
35  inline float GetMovementScale() const;
36  inline const TextureRef& GetTexture() const;
37  inline TextureSampler& GetTextureSampler();
38  inline const TextureSampler& GetTextureSampler() const;
39 
40  inline void SetMovementOffset(const Vector3f& offset);
41  inline void SetMovementScale(float scale);
42  inline void SetTexture(TextureRef cubemapTexture);
43  inline void SetTextureSampler(const TextureSampler& sampler);
44 
45  template<typename... Args> static SkyboxBackgroundRef New(Args&&... args);
46 
47  private:
48  static bool Initialize();
49  static void Uninitialize();
50 
51  TextureRef m_texture;
52  TextureSampler m_sampler;
53  Vector3f m_movementOffset;
54  float m_movementScale;
55  };
56 }
57 
58 #include <Nazara/Graphics/SkyboxBackground.inl>
59 
60 #endif // NAZARA_SKYBOXBACKGROUND_HPP
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 the module initializer of Graphics.
Definition: Graphics.hpp:15
Graphics class that represents a background with a cubemap texture.
Definition: SkyboxBackground.hpp:23
Graphics class that represents the background for our scene.
Definition: AbstractBackground.hpp:25