GLBuffer

WebGL buffer, used for Vertex and Index buffers.

Constructor

new L3D.GLBuffer()

Methods

bind(location)

Binds the buffer to an attribute location.

Parameters
location *

destroy()

Delete the WebGL data for the buffer.

unbind(location)

Unbinds the buffer from an attribute location.

Parameters
location *

upload(data, usage)

Uploads the buffer data (stored in this.data) to the GPU.

Parameters
data TypedArray
usage number

default gl.STATIC_DRAW (other: gl.DYNAMIC_DRAW, gl.STREAM_DRAW)

uploadRange(start, size)

Uploads part of the buffer data (stored in this.data) to the GPU

Parameters
start number

offset in bytes

size number

sizes in bytes