Added a method to VertexIndex to determine the size in bytes of an element in the index array

This commit is contained in:
Alex Szpakowski
2013-01-30 17:50:32 -04:00
parent a9211a1389
commit de959b7275
2 changed files with 23 additions and 5 deletions
+12 -4
View File
@@ -331,10 +331,6 @@ private:
// Set if the buffer was modified while operating on gpu memory
// and needs to be synchronized.
bool is_dirty;
// Usage hint for map()/unmap() pair. Same as `access' parameter in
// glBufferData or 0 if not mapped.
GLenum mapped_access;
};
/**
@@ -409,6 +405,15 @@ public:
return getType(maxSize);
}
/**
* Returns the size in bytes of an element in the element array.
* Can be used with getPointer to calculate an offset into the array based
* on a number of elements.
*
* @return The size of an element in bytes.
**/
size_t getElementSize();
/**
* Returns the pointer to the VertexBuffer.
* The pointer will change if a new size request or removal causes
@@ -463,6 +468,9 @@ private:
// The size of the array requested by this instance.
size_t size;
// The size in bytes of an element in the element array.
size_t elementSize;
// The current VertexBuffer size. 0 means no VertexBuffer.
static size_t maxSize;
// The list of sizes. Needs to be kept sorted in ascending order.