new VertexArray
DOC_TBA
Throws:
Methods
-
destroy
-
Destroys the WebGL resources held by this object. Destroying an object allows for deterministic release of WebGL resources, instead of relying on the garbage collector to destroy this object.
Only call this if the vertex array owns the vertex buffers referenced by the attributes and owns its index buffer; otherwise, the owner of the buffers is responsible for destroying them. A vertex or index buffer is only destroyed if it'sgetVertexArrayDestroyable
function returnstrue
(the default). This allows combining destroyable and non-destroyable buffers in the same vertex array.
Once an object is destroyed, it should not be used; calling any function other thanisDestroyed
will result in a DeveloperError exception. Therefore, assign the return value (undefined
) to the object as done in the example.Throws:
DeveloperError : This vertex array was destroyed, i.e., destroy() was called.Returns:
Example
// Destroying the vertex array implicitly calls destroy for each of its vertex // buffers and its index buffer. var vertexBuffer = context.createVertexBuffer(new Float32Array([0, 0, 0]), BufferUsage.STATIC_DRAW); var vertexArray = context.createVertexArray({ vertexBuffer : vertexBuffer, componentsPerAttribute : 3 }); // ... vertexArray = vertexArray.destroy(); // Calling vertexBuffer.destroy() would throw DeveloperError at this point.
-
getAttribute
-
DOC_TBA index is the location in the array of attributes, not the index property of an attribute.
Throws:
-
DeveloperError : index is required.
-
DeveloperError : This vertex array was destroyed, i.e., destroy() was called.
-
-
getIndexBuffer
-
DOC_TBA
Throws:
DeveloperError : This vertex array was destroyed, i.e., destroy() was called.Returns:
Buffer DOC_TBA. -
getNumberOfAttributes
-
DOC_TBA
Throws:
DeveloperError : This vertex array was destroyed, i.e., destroy() was called. -
isDestroyed
-
Returns true if this object was destroyed; otherwise, false.
If this object was destroyed, it should not be used; calling any function other thanisDestroyed
will result in a DeveloperError exception.Returns:
Boolean True if this object was destroyed; otherwise, false.See: