Provides allocation and freeing of ranges with in VertexBuffers.
The VertexBufferManager will create and free any VertexBuffers it requires.
Required scripts
The VertexBufferManager object requires:
/*{{ javascript("jslib/vertexbuffermanager.js") }}*/
Summary
Syntax
var vertexBufferManager = VertexBufferManager.create(graphicsDevice, dynamic);
Summary
Allocate a number of vertices of a given format.
The returned object should be retained to pass to free().
Syntax
var attributes = [graphicsDevice.VERTEXFORMAT_FLOAT4,
graphicsDevice.VERTEXFORMAT_FLOAT4,
graphicsDevice.VERTEXFORMAT_FLOAT3,
graphicsDevice.VERTEXFORMAT_FLOAT3,
graphicsDevice.VERTEXFORMAT_FLOAT2];
var allocation = vertexBufferManager.allocate(numVertices , attributes);
var vertexBuffer = allocation.vertexBuffer;
var baseIndex = allocation.baseIndex;
The returned object has two public values:
Summary
Called to free an allocation from the VertexBufferManager.
Syntax
vertexBufferManager.free(allocation);
Summary
Called when the object is no longer required.
Syntax
vertexBufferManager.destroy();