NAP
rendertexturecube.h
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2  * License, v. 2.0. If a copy of the MPL was not distributed with this
3  * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4 
5 #pragma once
6 
7 // Internal Includes
8 #include "texture.h"
9 #include "irendertarget.h"
10 
11 // External Includes
12 #include <color.h>
13 
14 namespace nap
15 {
16  // Forward Declares
17  class Core;
18 
36  class NAPAPI RenderTextureCube : public TextureCube
37  {
38  RTTI_ENABLE(TextureCube)
39  public:
43  enum class EFormat
44  {
45  RGBA8,
46  BGRA8,
47  R8,
48  RGBA16,
49  R16,
50  RGBA32,
51  R32
52  };
53 
54  RenderTextureCube(Core& core);
55 
61  virtual bool init(utility::ErrorState& errorState) override;
62 
63  int mWidth = 0;
64  int mHeight = 0;
66  EFormat mColorFormat = EFormat::RGBA8;
67  RGBAColorFloat mClearColor = { 0.0f, 0.0f, 0.0f, 0.0f };
68 
69  protected:
70  bool mGenerateLODs = false;
71  };
72 
73 
91  class NAPAPI DepthRenderTextureCube : public TextureCube
92  {
93  friend class CubeDepthRenderTarget;
94  RTTI_ENABLE(TextureCube)
95  public:
99  enum class EDepthFormat
100  {
101  D16,
102  D32
103  };
104 
106 
112  virtual bool init(utility::ErrorState& errorState) override;
113 
114  int mWidth = 0;
115  int mHeight = 0;
117  EDepthFormat mDepthFormat = EDepthFormat::D16;
118  float mClearValue = 1.0f;
119  bool mFill = false;
120  };
121 }
nap::RenderTextureCube::EFormat
EFormat
Definition: rendertexturecube.h:43
nap::TextureCube
Definition: texture.h:298
nap::DepthRenderTextureCube::EDepthFormat
EDepthFormat
Definition: rendertexturecube.h:99
nap::RGBAColor< float >
nap::EColorSpace::Linear
@ Linear
Linear color space.
nap::utility::ErrorState
Definition: errorstate.h:19
nap::RenderTextureCube
Definition: rendertexturecube.h:36
nap::Core
Definition: core.h:82
nap
Definition: templateapp.h:17
nap::DepthRenderTextureCube
Definition: rendertexturecube.h:91
nap::EColorSpace
EColorSpace
Definition: surfacedescriptor.h:37
nap::CubeDepthRenderTarget
Definition: cubedepthrendertarget.h:40