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 compatibily 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 ArrayBuffer | ArrayBufferView

a typedArray

Returns:

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

Type
number

(static) getGLTypeForTypedArrayType(typedArrayType) → {number}

Get the GL type for a typedArray type

Parameters:
Name Type Description
typedArrayType ArrayBufferViewType

a typedArray constructor

Returns:

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

Type
number

(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:

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

Type
function