ArrayBuffer

ArrayBuffer

new ArrayBuffer(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

attribPointer(attribute)

set the attribute pointer
Parameters
Name Type Description
attribute object attribute

attribPointerInstanced(attribute, divisor)

set the attribute pointer
Parameters
Name Type Description
attribute object attribute
divisor number divisor

bind()

Bind the arrayBuffer

computeLenght(attribSize)

compute the length of the buffer depending of the data type
Parameters
Name Type Description
attribSize number attribSize

data(data)

add data to the arrayBuffer
Parameters
Name Type Description
data Float32Array data

draw(mode, offsetopt)

draw the arrayBuffer
Parameters
Name Type Attributes Default Description
mode object webgl mode gl.TRIANGLES...
offset number <optional>
0 offset for strided data

unbind()

Unbind the arrayBuffer