24 Texture(
unsigned int numItems, DFType
format,
unsigned int numDimensions,
25 unsigned int dim0,
unsigned int dim1,
unsigned int dim2,
26 bool hasMipmaps,
bool createStorage);
30 inline unsigned int GetNumItems()
const;
31 inline DFType GetFormat()
const;
32 inline unsigned int GetNumDimensions()
const;
33 inline unsigned int GetDimension(
int i)
const;
46 enum { MAX_MIPMAP_LEVELS = 16 };
47 inline bool HasMipmaps()
const;
48 inline unsigned int GetNumLevels()
const;
49 inline unsigned int GetDimensionFor(
unsigned int level,
int i)
const;
50 inline unsigned int GetNumElementsFor(
unsigned int level)
const;
51 inline unsigned int GetNumBytesFor(
unsigned int level)
const;
52 inline unsigned int GetOffsetFor(
unsigned int item,
53 unsigned int level)
const;
54 inline char const* GetDataFor(
unsigned int item,
55 unsigned int level)
const;
56 inline char* GetDataFor(
unsigned int item,
unsigned int level);
57 template <
typename T>
inline T
const* GetFor(
unsigned int item,
58 unsigned int level)
const;
59 template <
typename T>
inline T* GetFor(
unsigned int item,
63 inline unsigned int GetNumSubresources()
const;
64 unsigned int GetIndex(
unsigned int item,
unsigned int level)
const;
71 void AutogenerateMipmaps();
72 inline bool WantAutogenerateMipmaps()
const;
77 static unsigned int GetTotalElements(
unsigned int numItems,
78 unsigned int dim0,
unsigned int dim1,
unsigned int dim2,
85 std::array<std::array<unsigned int, 3>, MAX_MIPMAP_LEVELS>
mLDimension;
87 std::vector<std::array<unsigned int, MAX_MIPMAP_LEVELS>>
mLOffset;
107 return mNumDimensions;
112 return mLDimension[0][i];
128 return mLDimension[
level][i];
133 return mLNumBytes[
level] / mElementSize;
138 return mLNumBytes[
level];
142 unsigned int level)
const 144 return mLOffset[item][
level];
148 unsigned int level)
const 150 return mData ? (mData + mLOffset[item][
level]) :
nullptr;
155 return mData ? (mData + mLOffset[item][
level]) :
nullptr;
158 template <
typename T>
inline T
161 return reinterpret_cast<T const*
>(GetDataFor(item, level));
164 template <
typename T>
inline 167 return reinterpret_cast<T*
>(GetDataFor(item, level));
172 return mNumItems * mNumLevels;
177 return mAutogenerateMipmaps;
std::array< unsigned int, MAX_MIPMAP_LEVELS > mLNumBytes
std::function< void(std::shared_ptr< Texture > const &)> TextureUpdater
unsigned int mNumDimensions
bool mAutogenerateMipmaps
std::vector< std::array< unsigned int, MAX_MIPMAP_LEVELS > > mLOffset
std::function< void(std::shared_ptr< Texture > const &, unsigned int)> TextureLevelUpdater
char const * GetDataFor(unsigned int item, unsigned int level) const
unsigned int GetNumDimensions() const
typedef int(WINAPI *PFNWGLRELEASEPBUFFERDCARBPROC)(HPBUFFERARB hPbuffer
unsigned int GetNumBytesFor(unsigned int level) const
GLint GLint GLsizei GLint GLenum format
unsigned int GetDimensionFor(unsigned int level, int i) const
unsigned int GetNumItems() const
unsigned int GetNumLevels() const
unsigned int GetDimension(int i) const
unsigned int GetNumElementsFor(unsigned int level) const
bool WantAutogenerateMipmaps() const
T const * GetFor(unsigned int item, unsigned int level) const
unsigned int GetOffsetFor(unsigned int item, unsigned int level) const
unsigned int GetNumSubresources() const
std::array< std::array< unsigned int, 3 >, MAX_MIPMAP_LEVELS > mLDimension