twgl/typedArray

Low level shader typed array related functions

You should generally not need to use these functions. They are provided
for those cases where you're doing something out of the ordinary
and you need lower level access.

For backward compatibility they are available at both twgl.typedArray and twgl
itself

See module:twgl for core functions

Methods

(static) getGLTypeForTypedArray(typedArray) → {number}

Get the GL type for a typedArray

Parameters:
Name Type Description
typedArray ArrayBufferView

a typedArray

Returns:
Type:
number

the GL type for array. For example pass in an Int8Array and gl.BYTE will
be returned. Pass in a Uint32Array and gl.UNSIGNED_INT will be returned

(static) getGLTypeForTypedArrayType(typedArrayType) → {number}

Get the GL type for a typedArray type

Parameters:
Name Type Description
typedArrayType ArrayBufferView

a typedArray constructor

Returns:
Type:
number

the GL type for type. For example pass in Int8Array and gl.BYTE will
be returned. Pass in Uint32Array and gl.UNSIGNED_INT will be returned

(static) getTypedArrayTypeForGLType(type) → {function}

Get the typed array constructor for a given GL type

Parameters:
Name Type Description
type number

the GL type. (eg: gl.UNSIGNED_INT)

Returns:
Type:
function

the constructor for a the corresponding typed array. (eg. Uint32Array).