ITexture.h
Go to the documentation of this file.
1 
2 #pragma once
3 
4 #include <ionCore.h>
5 #include <ionMath.h>
6 
7 
8 namespace ion
9 {
10  namespace Graphics
11  {
12 
14  class ITexture
15  {
16  public:
17 
19  // Texture Params //
21 
22  enum class EFilter
23  {
24  Nearest = 0,
25  Linear = 1,
26  };
27 
28  enum class EWrapMode
29  {
30  Clamp = 0,
31  Mirror = 1,
32  Repeat = 2,
33  };
34 
35  enum class EFormatComponents
36  {
37  R = 0,
38  RG = 1,
39  RGB = 2,
40  RGBA = 3,
41  };
42 
44  {
45  Fix8 = 0,
46  Float16 = 1,
47  Float32 = 2,
48  SignedInt8 = 3,
49  SignedInt16 = 4,
50  SignedInt32 = 5,
51  UnsignedInt8 = 6,
52  UnsignedInt16 = 7,
53  UnsignedInt32 = 8,
54  Depth = 9,
55  };
56 
57  enum class EMipMaps
58  {
59  False = 0,
60  True = 1,
61  };
62 
65  virtual void SetMinFilter(EFilter const MinFilter) = 0;
66 
69  virtual void SetMagFilter(EFilter const MagFilter) = 0;
70 
73  virtual void SetMipMapFilter(EFilter const MipMapFilter) = 0;
74 
77  virtual void SetWrapMode(EWrapMode const WrapMode) = 0;
78 
82  virtual void SetAnisotropy(float const Anisotropy) = 0;
83 
84  virtual EFilter GetMinFilter() = 0;
85  virtual EFilter GetMagFilter() = 0;
86  virtual EFilter GetMipMapFilter() = 0;
87  virtual EWrapMode GetWrapMode() = 0;
88  virtual float GetAnisotropy() = 0;
89 
90  };
91 
93  class ITexture2D : public virtual ITexture
94  {
95 
96  public:
97 
98  virtual void Upload(void const * const Data, vec2u const & Size, EFormatComponents const Components, EScalarType const Type) = 0;
99  virtual void UploadSubRegion(void const * const Data, vec2u const & Offset, vec2u const & Size, EFormatComponents const Components, EScalarType const Type) = 0;
100 
101  virtual void GetData(void * const Data, vec2u const & Size, EFormatComponents const Components, EScalarType const Type) = 0;
102 
103  };
104 
106  class ITexture2DArray : public virtual ITexture
107  {
108 
109  public:
110 
111  virtual void Upload(void const * const Data, vec3u const & Size, EFormatComponents const Components, EScalarType const Type) = 0;
112  virtual void UploadSubRegion(void const * const Data, vec3u const & Offset, vec3u const & Size, EFormatComponents const Components, EScalarType const Type) = 0;
113 
114  };
115 
117  class ITexture3D : public virtual ITexture
118  {
119 
120  public:
121 
122  virtual void Upload(void const * const Data, vec3u const & Size, EFormatComponents const Components, EScalarType const Type) = 0;
123  virtual void UploadSubRegion(void const * const Data, vec3u const & Offset, vec3u const & Size, EFormatComponents const Components, EScalarType const Type) = 0;
124 
125  };
126 
128  class ITextureCubeMap : public virtual ITexture
129  {
130 
131  public:
132 
133  enum class EFace
134  {
135  PositiveX = 0,
136  NegativeX = 1,
137  PositiveY = 2,
138  NegativeY = 3,
139  PositiveZ = 4,
140  NegativeZ = 5
141  };
142 
143  virtual void Upload(EFace const Face, void const * const Data, vec2u const & Size, EFormatComponents const Components, EScalarType const Type) = 0;
144  virtual void UploadSubRegion(EFace const Face, void const * const Data, vec2u const & Offset, vec2u const & Size, EFormatComponents const Components, EScalarType const Type) = 0;
145 
146  };
147 
148  }
149 }
virtual void SetMagFilter(EFilter const MagFilter)=0
virtual EFilter GetMagFilter()=0
Definition: ITexture.h:14
Definition: ITexture.h:117
virtual float GetAnisotropy()=0
EWrapMode
Definition: ITexture.h:28
Definition: ITexture.h:106
virtual void SetMipMapFilter(EFilter const MipMapFilter)=0
EFace
Definition: ITexture.h:133
EInternalFormatType
Definition: ITexture.h:43
Definition: CCatmullRomAdvancedSplineInterpolator.h:7
EFilter
Definition: ITexture.h:22
Definition: ITexture.h:128
EScalarType
Value types that exclude vector types.
Definition: Enums.h:33
EMipMaps
Definition: ITexture.h:57
virtual void SetAnisotropy(float const Anisotropy)=0
Definition: ITexture.h:93
virtual EFilter GetMipMapFilter()=0
virtual void SetWrapMode(EWrapMode const WrapMode)=0
EFormatComponents
Definition: ITexture.h:35
Lightweight wrapper for std::type_info that enables sorting (e.g. for use in a std::map) ...
Definition: ionClass.h:180
virtual void SetMinFilter(EFilter const MinFilter)=0
T Clamp(T const &v, T const &min, T const &max)
Definition: ionUtils.h:53
virtual EFilter GetMinFilter()=0
virtual EWrapMode GetWrapMode()=0