WebGL types

The following types are used in WebGL interfaces.

WebGL 1

These types are used within a WebGLRenderingContext.

TypeWeb IDL typeDescription
GLenumunsigned longUsed for enums. See also the list of constants.
GLbooleanbooleanA boolean value.
GLbitfieldunsigned longA bit field that stores multiple, logical bits. Used for example in WebGLRenderingContext.clear().
GLbytebyte8-bit twos complement signed integer.
GLshortshort16-bit twos complement signed integer.
GLintlong32-bit twos complement signed integer.
GLsizeilongUsed for sizes (e.g., width and height of the drawing buffer).
GLintptrlong longSpecial type for pointer arithmetic.
GLsizeiptrlong longSpecial type for pointer arithmetic.
GLubyteoctet8-bit unsigned integer.
GLushortunsigned short16-bit unsigned integer.
GLuintunsigned long32-bit unsigned integer.
GLfloatunrestricted float32-bit IEEE floating point number.
GLclampfunrestricted floatClamped 32-bit IEEE floating point number.

WebGL 2

These types are used within a WebGL2RenderingContext. All WebGL 1 types are used as well.

TypeWeb IDL typeDescription
GLint64long longSigned 64-bit integer number.

WebGL extensions

These types are used within WebGL extensions.

TypeWeb IDL typeDescription
GLuint64EXTlong longUnsigned 64-bit integer number.

Specifications

See also