|
nux-1.14.0
|
Public Member Functions | |
| VertexBuffer (int Size, int Stride) | |
| VertexBuffer (const VertexBuffer &) | |
| Copy constructor. | |
| VertexBuffer & | operator= (const VertexBuffer &) |
| Assignment constructor. | |
| void | Allocate (int num_index, int size) |
| Allocate space for a "num_element", each of size "size". | |
| int | GetSize () const |
| int | GetStride () const |
| int | GetNumElement () const |
| const void * | GetPtrRawData () const |
| void * | GetPtrRawData () |
Public Attributes | |
| std::vector< unsigned char > | _Data |
| int | _Stride |
Definition at line 34 of file GLVertexResourceManager.h.
| void nux::VertexBuffer::Allocate | ( | int | num_index, |
| int | size | ||
| ) |
Allocate space for a "num_element", each of size "size".
| num_element | Number of elements. |
| size | Number of byte for every element. |
Definition at line 72 of file GLVertexResourceManager.cpp.
{
nuxAssert(num_element > 0);
nuxAssert(size > 0);
if((size <= 0) || (num_element <= 0))
{
_Data.clear();
_Stride = 0;
return;
}
// Make sure Size is a multiple of Stride
int sz = size * num_element;
_Stride = size;
_Data.clear();
_Data.resize(sz);
}