Defined in:Establishes the size of a vertex buffer and initializes it.
void EstablishVertexBuffer(uint32 size, const void *data = nullptr);
||The size, in bytes, of the data that will be stored in the vertex buffer.|
||A pointer to the data that should initially be loaded into the vertex buffer.|
EstablishVertexBufferfunction establishes the size of a vertex buffer and initializes its internal resources. This function must be called before data is written to the vertex buffer with the
dataparameter is not
sizebytes are copied from the memory to which
datapoints into the vertex buffer. Otherwise, the contents of the vertex buffer are initially undefined. For a static vertex buffer, performance is best when the buffer data is supplied with the
sizeparameter should specify the maximum number of bytes of data that will be stored in the buffer. If the
sizeparameter is zero, then the vertex buffer's internal resources are deallocated, and the vertex buffer returns to the state it was in before the
EstablishVertexBufferfunction was first called. If the
sizeparameter is equal to the same value that was specified for a preceding call to the
EstablishVertexBufferfunction for the same vertex buffer, then the function quickly returns without reallocating any internal resources.
EstablishVertexBufferfunction can be called from any thread, but the caller must use synchronization mechanisms to ensure that the
EstablishVertexBufferfunction is not called for the same vertex buffer from multiple threads simultaneously.