23 Resource(
unsigned int numElements,
size_t elementSize,
bool createStorage =
true);
31 void DestroyStorage();
34 inline unsigned int GetNumElements()
const;
35 inline unsigned int GetElementSize()
const;
36 inline unsigned int GetNumBytes()
const;
47 inline void SetUsage(Usage
usage);
48 inline Usage GetUsage()
const;
61 inline void SetCopyType(CopyType copyType);
62 inline CopyType GetCopyType()
const;
69 inline void ResetData();
70 inline void SetData(
char*
data);
71 inline char const* GetData()
const;
72 inline char* GetData();
73 template <
typename T>
inline T
const* Get()
const;
74 template <
typename T>
inline T* Get();
87 void SetOffset(
unsigned int offset);
88 inline unsigned int GetOffset()
const;
89 void SetNumActiveElements(
unsigned int numActiveElements);
90 inline unsigned int GetNumActiveElements()
const;
91 inline unsigned int GetNumActiveBytes()
const;
133 mCopyType = copyType;
143 mData = (mStorage.size() > 0 ? mStorage.data() :
nullptr);
161 template <
typename T>
164 return reinterpret_cast<T const*
>(mData);
167 template <
typename T>
170 return reinterpret_cast<T*
>(mData);
180 return mNumActiveElements;
185 return mNumActiveElements*mElementSize;
unsigned int GetNumElements() const
unsigned int mNumElements
unsigned int GetOffset() const
void SetUsage(Usage usage)
unsigned int GetElementSize() const
unsigned int mElementSize
unsigned int GetNumBytes() const
char const * GetData() const
unsigned int GetNumActiveElements() const
GLsizeiptr const void GLenum usage
std::vector< char > mStorage
CopyType GetCopyType() const
void SetCopyType(CopyType copyType)
unsigned int GetNumActiveBytes() const
unsigned int mNumActiveElements