SharedVertexBuffer::Retain
Defined in:
Retains a reference to a shared vertex buffer.
C4Renderable.h
Prototype
int32 Retain(void);
Description
The Retain
function increments the reference count for a shared vertex buffer and returns the new reference count. This function takes no other action.If the returned reference count is one, then the caller has retained the first reference to the shared vertex buffer. In this case, the calling code should allocate the buffer's resources using the
VertexBuffer::EstablishVertexBuffer
function and define the vertex buffer's data using either the VertexBuffer::BeginUpdate
function or VertexBuffer::UpdateBuffer
function.When the owner of the retained reference is finished using the vertex buffer, it should call the
SharedVertexBuffer::Release
to release its reference, allowing the vertex buffer's resources to be deallocated if there are no other references.The initial reference count for a shared vertex buffer is zero.
See Also