mirror of
https://github.com/love2d/love.git
synced 2026-08-17 19:23:38 +02:00
Added a method to VertexIndex to determine the size in bytes of an element in the index array
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user