IndexBuffer

IndexBuffer

Members

Methods

new IndexBuffer(paramsopt)

Constructs a new ArrayBuffer
Parameters
Name Type Attributes Default Description
params object <optional>
{} options
Properties
Name Type Attributes Default Description
context string context webgl
data object <optional>
null data of the buffer
usage number <optional>
STATIC_DRAW webgl draw usage
divisor number <optional>
null divisor for instancing

Methods

bind()

Bind the indexBuffer

data(data)

add data to the indexBuffer
Parameters
Name Type Description
data Uint16Array data

draw(mode, offset)

draw the indexBuffer
Parameters
Name Type Description
mode object webgl mode gl.TRIANGLES...
offset offset offset for strided data

drawInstance(mode, count)

draw the indexBuffer
Parameters
Name Type Description
mode object webgl mode gl.TRIANGLES...
count number number of instances

unbind()

Unbind the indexBuffer