VertexBufferHandle
is a memory buffer that contain vertex data.
Vertex buffers can contain any vertex type - transformed or
untransformed, lit or unlit - that can be rendered through the use
of the rendering methods.
Public Member Functions
|
GraphicsDriverAPI |
VertexBufferHandle () |
GraphicsDriverAPI |
VertexBufferHandle (const VertexBufferHandle
&from) |
GraphicsDriverAPI
VertexBufferHandle
& |
operator= (const VertexBufferHandle
&from) |
virtual
GraphicsDriverAPI |
~VertexBufferHandle () |
GraphicsDriverAPI bool |
Initialize (size_t stride) |
|
Initialize this vertex buffer.
|
GraphicsDriverAPI void |
Clear () |
|
Clear all vertices in the buffer and set the
size of the buffer to zero.
|
GraphicsDriverAPI size_t |
GetVertexStride () const |
|
Get the size of each vertex of this buffer.
|
GraphicsDriverAPI size_t |
GetNumberOfVertices () const |
|
Get the real number of vertices in the
buffer.
|
GraphicsDriverAPI void |
SetNumberOfVertices (size_t numberOfVertices) |
|
Sets the real number of vertices in the
buffer.
|
GraphicsDriverAPI size_t |
GetCapacity () const |
|
Get the capacity of the buffer.
|
GraphicsDriverAPI void |
SetCapacity (size_t capacity) |
|
Sets the reserved capacity of the buffer.
|
GraphicsDriverAPI void |
SetInstanceCount (size_t count) |
|
Sets the number of instance contained in the
buffer.
|
GraphicsDriverAPI size_t |
GetInstanceCount () |
|
Get the number of instance contained in the
buffer.
|
GraphicsDriverAPI void |
SetStartOffset (size_t offset) |
|
Set start offset of this vertex buffer
Sometimes geometry data may store in different position when using
multiple vertex buffers.
|
GraphicsDriverAPI size_t |
GetStartOffset () |
|
Get start offset of this vertex buffer.
|
GraphicsDriverAPI unsigned char * |
Lock (size_t vertexIndex, size_t numberOfVertices) |
|
This function is used for reading/writing
data from/into the vertex buffer.
|
GraphicsDriverAPI void |
Unlock () |
|
Unlock the buffer to update.
|
GraphicsDriverAPI void |
SetBufferUsageType (BufferUsageType
bufferType) |
|
Sets the buffer usage type.
|
GraphicsDriverAPI void SetStartOffset |
( |
size_t |
offset |
) |
|
Set start offset of this vertex buffer Sometimes geometry data
may store in different position when using multiple vertex
buffers.
For example, assuming VertexBuffer1 stores geometry1 and
geometry2's position data, and VertexBuffer2 stores geometry2's
normal. When you want to render geometry2, you need VertexBuffer1's
start offset to correct value, otherwise you'll use geometry1's
position and geometry2's normal. Another situation is steam-out.
When you need to stream-out data to specific position of a vertex
buffer, you need to set start offset to that output buffer.
- Parameters:
-
offset |
the start offset of this vertex buffer |