new VertexArray()
Organizes vertex buffer and attribute state.
Properties:
Name | Type | Description |
---|---|---|
gl |
WebGLRenderingContext | The WebGL context. |
vertexArray |
WebGLVertexArrayObject | Vertex array object. |
numElements |
number | Number of elements in the vertex array. |
indexed |
boolean | Whether this vertex array is set up for indexed drawing. |
indexType |
GLenum | Data type of the indices. |
numInstances |
number | Number of instances to draw with this vertex array. |
appState |
Object | Tracked GL state. |
- Source:
Methods
delete() → {VertexArray}
Delete this vertex array.
- Source:
Returns:
The VertexArray object.
- Type
- VertexArray
indexBuffer(vertexBuffer) → {VertexArray}
Bind an index buffer to this vertex array.
Parameters:
Name | Type | Description |
---|---|---|
vertexBuffer |
VertexBuffer | The VertexBuffer to bind. |
- Source:
Returns:
The VertexArray object.
- Type
- VertexArray
instanceAttributeBuffer(attributeIndex, vertexBuffer, optionsopt) → {VertexArray}
Bind an per-instance attribute buffer to this vertex array.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
attributeIndex |
number | The attribute location to bind to. | |||||||||||||||||||||||||||||
vertexBuffer |
VertexBuffer | The VertexBuffer to bind. | |||||||||||||||||||||||||||||
options |
Object |
<optional> |
Attribute pointer options. These will override those provided in the
VertexBuffer.
Properties
|
- Source:
Returns:
The VertexArray object.
- Type
- VertexArray
restore() → {VertexArray}
Restore vertex array after context loss.
- Source:
Returns:
The VertexArray object.
- Type
- VertexArray
vertexAttributeBuffer(attributeIndex, vertexBuffer, optionsopt) → {VertexArray}
Bind an per-vertex attribute buffer to this vertex array.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
attributeIndex |
number | The attribute location to bind to. | |||||||||||||||||||||||||||||
vertexBuffer |
VertexBuffer | The VertexBuffer to bind. | |||||||||||||||||||||||||||||
options |
Object |
<optional> |
Attribute pointer options. These will override those provided in the
VertexBuffer.
Properties
|
- Source:
Returns:
The VertexArray object.
- Type
- VertexArray