Constructor
new VertexBuffer(arg, attributePointers, options)
Instantiates an VertexBuffer object.
- Source:
Parameters:
Name |
Type |
Description |
arg |
WebGLBuffer
|
VertexPackage
|
ArrayBuffer
|
Array
|
Number
|
The buffer or length of the buffer.
|
attributePointers |
Object
|
The array pointer map, or in the case of a vertex package arg, the options.
|
options |
Object
|
The rendering options.
Name |
Type |
Description |
mode |
string
|
The draw mode / primitive type.
|
indexOffset |
string
|
The index offset into the drawn buffer.
|
count |
string
|
The number of indices to draw.
|
|
Methods
Binds the vertex buffer object.
- Source:
Returns:
-
Type:
-
VertexBuffer
- Returns the vertex buffer object for chaining.
Upload vertex data to the GPU.
- Source:
Parameters:
Name |
Type |
Description |
arg |
Array
|
ArrayBuffer
|
ArrayBufferView
|
number
|
The array of data to buffer, or size of the buffer in bytes.
|
Returns:
-
Type:
-
VertexBuffer
The vertex buffer object, for chaining.
bufferSubData(array, byteOffset) → {VertexBuffer}
Upload partial vertex data to the GPU.
- Source:
Parameters:
Name |
Type |
Description |
array |
Array
|
ArrayBuffer
|
The array of data to buffer.
|
byteOffset |
number
|
The byte offset at which to buffer.
|
Returns:
-
Type:
-
VertexBuffer
The vertex buffer object, for chaining.
Execute the draw command for the bound buffer.
- Source:
Parameters:
Name |
Type |
Description |
options |
Object
|
The options to pass to 'drawArrays'. Optional.
Name |
Type |
Description |
mode |
string
|
The draw mode / primitive type.
|
indexOffset |
string
|
The index offset into the drawn buffer.
|
count |
string
|
The number of indices to draw.
|
|
Returns:
-
Type:
-
VertexBuffer
The vertex buffer object, for chaining.
Unbinds the vertex buffer object.
- Source:
Returns:
-
Type:
-
VertexBuffer
The vertex buffer object, for chaining.