BufferData

BufferData

The purpose of this class is to hold additional information regarding a typedarray buffer, like vbo 'usage' flags

Constructor

new BufferData(data, target)

Parameters:
Name Type Description
data ArrayBuffer

Data to wrap

target string

Type of data ('ArrayBuffer'/'ElementArrayBuffer')

Properties:
Name Type Description
data ArrayBuffer

Data to wrap

target string

Type of data ('ArrayBuffer'/'ElementArrayBuffer')

Methods

destroy(context)

Releases the allocated buffer

Parameters:
Name Type Description
context WebGLRenderingContext

setDataNeedsRefresh()

Tell the engine that a buffer has been updated and needs to be refreshed.

setDataUsage(dataUsage)

Set the usage type of this bufferdata.

Parameters:
Name Type Description
dataUsage string

Usage Type

Usage Type:
   'StaticDraw' - The data store contents will be specified once by the application,
       and used many times as the source for GL drawing commands
    'DynamicDraw' - The data store contents will be respecified repeatedly by the application, and used many times as the source for GL drawing commands.
     'StreamDraw' - The data store contents will be specified once by the application,
       and used at most a few times as the source of a GL drawing command