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  Border = 3
34  };
35 
36  enum class EFormatComponents
37  {
38  R = 0,
39  RG = 1,
40  RGB = 2,
41  RGBA = 3,
42  };
43 
45  {
46  Fix8 = 0,
47  Fix16 = 1,
48  Float16 = 2,
49  Float32 = 3,
50  SignedInt8 = 4,
51  SignedInt16 = 5,
52  SignedInt32 = 6,
53  UnsignedInt8 = 7,
54  UnsignedInt16 = 8,
55  UnsignedInt32 = 9,
56  Depth = 10,
57  };
58 
59  enum class EMipMaps
60  {
61  False = 0,
62  True = 1,
63  };
64 
67  virtual void SetMinFilter(EFilter const MinFilter) = 0;
68 
71  virtual void SetMagFilter(EFilter const MagFilter) = 0;
72 
75  virtual void SetMipMapFilter(EFilter const MipMapFilter) = 0;
76 
79  virtual void SetWrapMode(EWrapMode const WrapMode) = 0;
80 
83  virtual void SetBorderColor(color4f const & BorderColor) = 0;
84 
88  virtual void SetAnisotropy(float const Anisotropy) = 0;
89 
90  virtual EFilter GetMinFilter() = 0;
91  virtual EFilter GetMagFilter() = 0;
92  virtual EFilter GetMipMapFilter() = 0;
93  virtual EWrapMode GetWrapMode() = 0;
94  virtual float GetAnisotropy() = 0;
95 
96  virtual void GenerateMipMaps() = 0;
97 
98  };
99 
101  class ITexture2D : public virtual ITexture
102  {
103 
104  public:
105 
106  virtual void Upload(void const * const Data, vec2i const & Size, EFormatComponents const Components, EScalarType const Type) = 0;
107  virtual void UploadSubRegion(void const * const Data, vec2i const & Offset, vec2i const & Size, EFormatComponents const Components, EScalarType const Type) = 0;
108 
109  virtual void GetData(void * const Data, vec2i const & Size, EFormatComponents const Components, EScalarType const Type) = 0;
110 
111  };
112 
114  class ITexture2DArray : public virtual ITexture
115  {
116 
117  public:
118 
119  virtual void Upload(void const * const Data, vec3i const & Size, EFormatComponents const Components, EScalarType const Type) = 0;
120  virtual void UploadSubRegion(void const * const Data, vec3i const & Offset, vec3i const & Size, EFormatComponents const Components, EScalarType const Type) = 0;
121 
122  };
123 
125  class ITexture3D : public virtual ITexture
126  {
127 
128  public:
129 
130  virtual void Upload(void const * const Data, vec3i const & Size, EFormatComponents const Components, EScalarType const Type) = 0;
131  virtual void UploadSubRegion(void const * const Data, vec3i const & Offset, vec3i const & Size, EFormatComponents const Components, EScalarType const Type) = 0;
132 
133  };
134 
136  class ITextureCubeMap : public virtual ITexture
137  {
138 
139  public:
140 
141  enum class EFace
142  {
143  PositiveX = 0,
144  NegativeX = 1,
145  PositiveY = 2,
146  NegativeY = 3,
147  PositiveZ = 4,
148  NegativeZ = 5
149  };
150 
151  virtual void Upload(EFace const Face, void const * const Data, vec2i const & Size, EFormatComponents const Components, EScalarType const Type) = 0;
152  virtual void UploadSubRegion(EFace const Face, void const * const Data, vec2i const & Offset, vec2i const & Size, EFormatComponents const Components, EScalarType const Type) = 0;
153 
154  };
155 
156  }
157 }
virtual void SetMagFilter(EFilter const MagFilter)=0
virtual EFilter GetMagFilter()=0
Definition: ITexture.h:14
Definition: ITexture.h:125
virtual float GetAnisotropy()=0
EWrapMode
Definition: ITexture.h:28
Definition: ITexture.h:114
virtual void SetMipMapFilter(EFilter const MipMapFilter)=0
EFace
Definition: ITexture.h:141
EInternalFormatType
Definition: ITexture.h:44
virtual void SetBorderColor(color4f const &BorderColor)=0
Definition: CCatmullRomAdvancedSplineInterpolator.h:7
EFilter
Definition: ITexture.h:22
Definition: ITexture.h:136
EScalarType
Value types that exclude vector types.
Definition: Enums.h:33
EMipMaps
Definition: ITexture.h:59
Lightweight wrapper for std::type_info that enables sorting (e.g. for use in a std::map) ...
Definition: ionClass.h:20
virtual void SetAnisotropy(float const Anisotropy)=0
Definition: ITexture.h:101
virtual EFilter GetMipMapFilter()=0
virtual void SetWrapMode(EWrapMode const WrapMode)=0
EFormatComponents
Definition: ITexture.h:36
virtual void SetMinFilter(EFilter const MinFilter)=0
T Clamp(T const v, T const min, T const max)
Definition: ionUtils.h:45
virtual EFilter GetMinFilter()=0
virtual EWrapMode GetWrapMode()=0
virtual void GenerateMipMaps()=0