IndexBuffer

IndexBuffer

An index buffer class to hole indexing information.

Constructor

new IndexBuffer(arg, options)

Instantiates an IndexBuffer object.
Source:
Parameters:
Name Type Description
arg WebGLBuffer | Uint8Array | Uint16Array | Uin32Array | Array | Number The index data to buffer.
options Object The rendering options.
Name Type Description
mode string The draw mode / primitive type.
byteOffset string The byte offset into the drawn buffer.
count string The number of vertices to draw.

Methods

bufferData(arg) → {IndexBuffer}

Upload index data to the GPU.
Source:
Parameters:
Name Type Description
arg Array | ArrayBuffer | ArrayBufferView | number The array of data to buffer.
Returns:
Type:
IndexBuffer
The index buffer object, for chaining.

bufferSubData(array, byteOffset) → {IndexBuffer}

Upload partial index data to the GPU.
Source:
Parameters:
Name Type Description
array Array | ArrayBuffer | ArrayBufferView The array of data to buffer.
byteOffset number The byte offset at which to buffer.
Returns:
Type:
IndexBuffer
The index buffer object, for chaining.

draw(options) → {IndexBuffer}

Execute the draw command for the bound buffer.
Source:
Parameters:
Name Type Description
options Object The options to pass to 'drawElements'. Optional.
Name Type Description
mode string The draw mode / primitive type.
byteOffset string The byteOffset into the drawn buffer.
count string The number of vertices to draw.
Returns:
Type:
IndexBuffer
The index buffer object, for chaining.