HTML5 WebGL Canvas Context

The WebGLRenderingContext object is used to manage OpenGL state and render to the drawing buffer


Supported Platform(s)

- BlackBerry PlayBook 2.0
- BlackBerry 10
- Ripple Emulator
View Supported Platform Table
APIBB5.0BB6.0BB7.0PB1.0PB2.0BB10Ripple
canvas.getContext('experimental-webgl')         Y YY
activeTexture         Y YY
attachShader         Y YY
bindAttribLocation         Y YY
bindBuffer         Y YY
bindFramebuffer         Y YY
bindRenderbuffer         Y YY
bindTexture         Y YY
blendColor         Y YY
blendEquation         Y YY
blendEquationSeparate         Y YY
blendFunc         Y YY
blendFuncSeparate         Y YY
bufferData         Y YY
bufferData         Y YY
bufferData         Y YY
bufferSubData         Y YY
bufferSubData         Y YY
checkFramebufferStatus         Y YY
clear         Y YY
clearColor         Y YY
clearDepth         Y YY
clearStencil         Y YY
colorMask         Y YY
compileShader         Y YY
copyTexImage2D         Y YY
copyTexSubImage2D         Y YY
createBuffer         Y YY
createFramebuffer         Y YY
createProgram         Y YY
createRenderbuffer         Y YY
createShader         Y YY
createTexture         Y YY
cullFace         Y YY
deleteBuffer         Y YY
deleteFramebuffer         Y YY
deleteProgram         Y YY
deleteRenderbuffer         Y YY
deleteShader         Y YY
deleteTexture         Y YY
depthFunc         Y YY
depthMask         Y YY
depthRange         Y YY
detachShader         Y YY
disable         Y YY
disableVertexAttribArray         Y YY
drawArrays         Y YY
drawElements         Y YY
enable         Y YY
enableVertexAttribArray         Y YY
finish         Y YY
flush         Y YY
framebufferRenderbuffer         Y YY
framebufferTexture2D         Y YY
frontFace         Y YY
generateMipmap         Y YY
getActiveAttrib         Y YY
getActiveUniform         Y YY
getAttachedShaders         Y YY
getAttribLocation         Y YY
getBufferParameter         Y YY
getContextAttributes         Y YY
getError         Y YY
getExtension         Y YY
getFramebufferAttachmentParameter         Y YY
getParameter         Y YY
getProgramInfoLog         Y YY
getProgramParameter         Y YY
getRenderbufferParameter         Y YY
getShaderInfoLog         Y YY
getShaderParameter         Y YY
getShaderSource         Y YY
getSupportedExtensions         Y YY
getTexParameter         Y YY
getUniform         Y YY
getUniformLocation         Y YY
getVertexAttrib         Y YY
getVertexAttribOffset         Y YY
hint         Y YY
isBuffer         Y YY
isContextLost         Y YY
isEnabled         Y YY
isFramebuffer         Y YY
isProgram         Y YY
isRenderbuffer         Y YY
isShader         Y YY
isTexture         Y YY
lineWidth         Y YY
linkProgram         Y YY
pixelStorei         Y YY
polygonOffset         Y YY
readPixels         Y YY
renderbufferStorage         Y YY
sampleCoverage         Y YY
scissor         Y YY
shaderSource         Y YY
stencilFunc         Y YY
stencilFuncSeparate         Y YY
stencilMask         Y YY
stencilMaskSeparate         Y YY
stencilOp         Y YY
stencilOpSeparate         Y YY
texImage2D         Y YY
texImage2D         Y YY
texImage2D         Y YY
texImage2D         Y YY
texImage2D         Y YY
texParameterf         Y YY
texParameteri         Y YY
texSubImage2D         Y YY
texSubImage2D         Y YY
texSubImage2D         Y YY
texSubImage2D         Y YY
texSubImage2D         Y YY
uniform1f         Y YY
uniform1fv         Y YY
uniform1fv         Y YY
uniform1i         Y YY
uniform1iv         Y YY
uniform1iv         Y YY
uniform2f         Y YY
uniform2fv         Y YY
uniform2fv         Y YY
uniform2i         Y YY
uniform2iv         Y YY
uniform2iv         Y YY
uniform3f         Y YY
uniform3fv         Y YY
uniform3fv         Y YY
uniform3i         Y YY
uniform3iv         Y YY
uniform3iv         Y YY
uniform4f         Y YY
uniform4fv         Y YY
uniform4fv         Y YY
uniform4i         Y YY
uniform4iv         Y YY
uniform4iv         Y YY
uniformMatrix2fv         Y YY
uniformMatrix2fv         Y YY
uniformMatrix3fv         Y YY
uniformMatrix3fv         Y YY
uniformMatrix4fv         Y YY
uniformMatrix4fv         Y YY
useProgram         Y YY
validateProgram         Y YY
vertexAttrib1f         Y YY
vertexAttrib1fv         Y YY
vertexAttrib1fv         Y YY
vertexAttrib2f         Y YY
vertexAttrib2fv         Y YY
vertexAttrib2fv         Y YY
vertexAttrib3f         Y YY
vertexAttrib3fv         Y YY
vertexAttrib3fv         Y YY
vertexAttrib4f         Y YY
vertexAttrib4fv         Y YY
vertexAttrib4fv         Y YY
vertexAttribPointer         Y YY
viewport         Y YY
canvas         Y YY
STENCIL_BUFFER_BIT         Y YY
COLOR_BUFFER_BIT         Y YY
POINTS         Y YY
LINES         Y YY
LINE_LOOP         Y YY
LINE_STRIP         Y YY
TRIANGLES         Y YY
TRIANGLE_STRIP         Y YY
TRIANGLE_FAN         Y YY
ZERO         Y YY
ONE         Y YY
SRC_COLOR         Y YY
ONE_MINUS_SRC_COLOR         Y YY
SRC_ALPHA         Y YY
ONE_MINUS_SRC_ALPHA         Y YY
DST_ALPHA         Y YY
ONE_MINUS_DST_ALPHA         Y YY
DST_COLOR         Y YY
ONE_MINUS_DST_COLOR         Y YY
SRC_ALPHA_SATURATE         Y YY
FUNC_ADD         Y YY
BLEND_EQUATION         Y YY
BLEND_EQUATION_RGB         Y YY
BLEND_EQUATION_ALPHA         Y YY
FUNC_SUBTRACT         Y YY
FUNC_REVERSE_SUBTRACT         Y YY
BLEND_DST_RGB         Y YY
BLEND_SRC_RGB         Y YY
BLEND_DST_ALPHA         Y YY
BLEND_SRC_ALPHA         Y YY
CONSTANT_COLOR         Y YY
ONE_MINUS_CONSTANT_COLOR         Y YY
CONSTANT_ALPHA         Y YY
ONE_MINUS_CONSTANT_ALPHA         Y YY
BLEND_COLOR         Y YY
ARRAY_BUFFER         Y YY
ELEMENT_ARRAY_BUFFER         Y YY
ARRAY_BUFFER_BINDING         Y YY
ELEMENT_ARRAY_BUFFER_BINDING         Y YY
STREAM_DRAW         Y YY
STATIC_DRAW         Y YY
DYNAMIC_DRAW         Y YY
BUFFER_SIZE         Y YY
BUFFER_USAGE         Y YY
CURRENT_VERTEX_ATTRIB         Y YY
FRONT         Y YY
BACK         Y YY
FRONT_AND_BACK         Y YY
TEXTURE_2D         Y YY
CULL_FACE         Y YY
BLEND         Y YY
DITHER         Y YY
STENCIL_TEST         Y YY
DEPTH_TEST         Y YY
SCISSOR_TEST         Y YY
POLYGON_OFFSET_FILL         Y YY
SAMPLE_ALPHA_TO_COVERAGE         Y YY
SAMPLE_COVERAGE         Y YY
NO_ERROR         Y YY
INVALID_ENUM         Y YY
INVALID_VALUE         Y YY
INVALID_OPERATION         Y YY
OUT_OF_MEMORY         Y YY
CW         Y YY
CCW         Y YY
LINE_WIDTH         Y YY
ALIASED_POINT_SIZE_RANGE         Y YY
ALIASED_LINE_WIDTH_RANGE         Y YY
CULL_FACE_MODE         Y YY
FRONT_FACE         Y YY
DEPTH_RANGE         Y YY
DEPTH_WRITEMASK         Y YY
DEPTH_CLEAR_VALUE         Y YY
DEPTH_FUNC         Y YY
STENCIL_CLEAR_VALUE         Y YY
STENCIL_FUNC         Y YY
STENCIL_FAIL         Y YY
STENCIL_PASS_DEPTH_FAIL         Y YY
STENCIL_PASS_DEPTH_PASS         Y YY
STENCIL_REF         Y YY
STENCIL_VALUE_MASK         Y YY
STENCIL_WRITEMASK         Y YY
STENCIL_BACK_FUNC         Y YY
STENCIL_BACK_FAIL         Y YY
STENCIL_BACK_PASS_DEPTH_FAIL         Y YY
STENCIL_BACK_PASS_DEPTH_PASS         Y YY
STENCIL_BACK_REF         Y YY
STENCIL_BACK_VALUE_MASK         Y YY
STENCIL_BACK_WRITEMASK         Y YY
VIEWPORT         Y YY
SCISSOR_BOX         Y YY
COLOR_CLEAR_VALUE         Y YY
COLOR_WRITEMASK         Y YY
UNPACK_ALIGNMENT         Y YY
PACK_ALIGNMENT         Y YY
MAX_TEXTURE_SIZE         Y YY
MAX_VIEWPORT_DIMS         Y YY
SUBPIXEL_BITS         Y YY
RED_BITS         Y YY
GREEN_BITS         Y YY
BLUE_BITS         Y YY
ALPHA_BITS         Y YY
DEPTH_BITS         Y YY
STENCIL_BITS         Y YY
POLYGON_OFFSET_UNITS         Y YY
POLYGON_OFFSET_FACTOR         Y YY
TEXTURE_BINDING_2D         Y YY
SAMPLE_BUFFERS         Y YY
SAMPLES         Y YY
SAMPLE_COVERAGE_VALUE         Y YY
SAMPLE_COVERAGE_INVERT         Y YY
NUM_COMPRESSED_TEXTURE_FORMATS         Y YY
COMPRESSED_TEXTURE_FORMATS         Y YY
DONT_CARE         Y YY
FASTEST         Y YY
NICEST         Y YY
GENERATE_MIPMAP_HINT         Y YY
BYTE         Y YY
UNSIGNED_BYTE         Y YY
SHORT         Y YY
UNSIGNED_SHORT         Y YY
INT         Y YY
UNSIGNED_INT         Y YY
FLOAT         Y YY
DEPTH_COMPONENT         Y YY
ALPHA         Y YY
RGB         Y YY
RGBA         Y YY
LUMINANCE         Y YY
LUMINANCE_ALPHA         Y YY
UNSIGNED_SHORT_4_4_4_4         Y YY
UNSIGNED_SHORT_5_5_5_1         Y YY
UNSIGNED_SHORT_5_6_5         Y YY
FRAGMENT_SHADER         Y YY
VERTEX_SHADER         Y YY
MAX_VERTEX_ATTRIBS         Y YY
MAX_VERTEX_UNIFORM_VECTORS         Y YY
MAX_VARYING_VECTORS         Y YY
MAX_COMBINED_TEXTURE_IMAGE_UNITS         Y YY
MAX_VERTEX_TEXTURE_IMAGE_UNITS         Y YY
MAX_TEXTURE_IMAGE_UNITS         Y YY
MAX_FRAGMENT_UNIFORM_VECTORS         Y YY
SHADER_TYPE         Y YY
DELETE_STATUS         Y YY
LINK_STATUS         Y YY
VALIDATE_STATUS         Y YY
ATTACHED_SHADERS         Y YY
ACTIVE_UNIFORMS         Y YY
ACTIVE_UNIFORM_MAX_LENGTH         Y YY
ACTIVE_ATTRIBUTES         Y YY
ACTIVE_ATTRIBUTE_MAX_LENGTH         Y YY
SHADING_LANGUAGE_VERSION         Y YY
CURRENT_PROGRAM         Y YY
NEVER         Y YY
LESS         Y YY
EQUAL         Y YY
LEQUAL         Y YY
GREATER         Y YY
NOTEQUAL         Y YY
GEQUAL         Y YY
ALWAYS         Y YY
KEEP         Y YY
REPLACE         Y YY
INCR         Y YY
DECR         Y YY
INVERT         Y YY
INCR_WRAP         Y YY
DECR_WRAP         Y YY
VENDOR         Y YY
RENDERER         Y YY
VERSION         Y YY
NEAREST         Y YY
LINEAR         Y YY
NEAREST_MIPMAP_NEAREST         Y YY
LINEAR_MIPMAP_NEAREST         Y YY
NEAREST_MIPMAP_LINEAR         Y YY
LINEAR_MIPMAP_LINEAR         Y YY
TEXTURE_MAG_FILTER         Y YY
TEXTURE_MIN_FILTER         Y YY
TEXTURE_WRAP_S         Y YY
TEXTURE_WRAP_T         Y YY
TEXTURE         Y YY
TEXTURE_CUBE_MAP         Y YY
TEXTURE_BINDING_CUBE_MAP         Y YY
TEXTURE_CUBE_MAP_POSITIVE_X         Y YY
TEXTURE_CUBE_MAP_NEGATIVE_X         Y YY
TEXTURE_CUBE_MAP_POSITIVE_Y         Y YY
TEXTURE_CUBE_MAP_NEGATIVE_Y         Y YY
TEXTURE_CUBE_MAP_POSITIVE_Z         Y YY
TEXTURE_CUBE_MAP_NEGATIVE_Z         Y YY
MAX_CUBE_MAP_TEXTURE_SIZE         Y YY
TEXTURE0         Y YY
TEXTURE1         Y YY
TEXTURE2         Y YY
TEXTURE3         Y YY
TEXTURE4         Y YY
TEXTURE5         Y YY
TEXTURE6         Y YY
TEXTURE7         Y YY
TEXTURE8         Y YY
TEXTURE9         Y YY
TEXTURE10         Y YY
TEXTURE11         Y YY
TEXTURE12         Y YY
TEXTURE13         Y YY
TEXTURE14         Y YY
TEXTURE15         Y YY
TEXTURE16         Y YY
TEXTURE17         Y YY
TEXTURE18         Y YY
TEXTURE19         Y YY
TEXTURE20         Y YY
TEXTURE21         Y YY
TEXTURE22         Y YY
TEXTURE23         Y YY
TEXTURE24         Y YY
TEXTURE25         Y YY
TEXTURE26         Y YY
TEXTURE27         Y YY
TEXTURE28         Y YY
TEXTURE29         Y YY
TEXTURE30         Y YY
TEXTURE31         Y YY
ACTIVE_TEXTURE         Y YY
REPEAT         Y YY
CLAMP_TO_EDGE         Y YY
MIRRORED_REPEAT         Y YY
FLOAT_VEC2         Y YY
FLOAT_VEC3         Y YY
FLOAT_VEC4         Y YY
INT_VEC2         Y YY
INT_VEC3         Y YY
INT_VEC4         Y YY
BOOL         Y YY
BOOL_VEC2         Y YY
BOOL_VEC3         Y YY
BOOL_VEC4         Y YY
FLOAT_MAT2         Y YY
FLOAT_MAT3         Y YY
FLOAT_MAT4         Y YY
SAMPLER_2D         Y YY
SAMPLER_CUBE         Y YY
VERTEX_ATTRIB_ARRAY_ENABLED         Y YY
VERTEX_ATTRIB_ARRAY_SIZE         Y YY
VERTEX_ATTRIB_ARRAY_STRIDE         Y YY
VERTEX_ATTRIB_ARRAY_TYPE         Y YY
VERTEX_ATTRIB_ARRAY_NORMALIZED         Y YY
VERTEX_ATTRIB_ARRAY_POINTER         Y YY
VERTEX_ATTRIB_ARRAY_BUFFER_BINDING         Y YY
COMPILE_STATUS         Y YY
INFO_LOG_LENGTH         Y YY
SHADER_SOURCE_LENGTH         Y YY
LOW_FLOAT         Y YY
MEDIUM_FLOAT         Y YY
HIGH_FLOAT         Y YY
LOW_INT         Y YY
MEDIUM_INT         Y YY
HIGH_INT         Y YY
FRAMEBUFFER         Y YY
RENDERBUFFER         Y YY
RGBA4         Y YY
RGB5_A1         Y YY
RGB565         Y YY
DEPTH_COMPONENT16         Y YY
STENCIL_INDEX         Y YY
STENCIL_INDEX8         Y YY
DEPTH_STENCIL         Y YY
RENDERBUFFER_WIDTH         Y YY
RENDERBUFFER_HEIGHT         Y YY
RENDERBUFFER_INTERNAL_FORMAT         Y YY
RENDERBUFFER_RED_SIZE         Y YY
RENDERBUFFER_GREEN_SIZE         Y YY
RENDERBUFFER_BLUE_SIZE         Y YY
RENDERBUFFER_ALPHA_SIZE         Y YY
RENDERBUFFER_DEPTH_SIZE         Y YY
RENDERBUFFER_STENCIL_SIZE         Y YY
FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE         Y YY
FRAMEBUFFER_ATTACHMENT_OBJECT_NAME         Y YY
FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL         Y YY
FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE         Y YY
COLOR_ATTACHMENT0         Y YY
DEPTH_ATTACHMENT         Y YY
STENCIL_ATTACHMENT         Y YY
DEPTH_STENCIL_ATTACHMENT         Y YY
NONE         Y YY
FRAMEBUFFER_COMPLETE         Y YY
FRAMEBUFFER_INCOMPLETE_ATTACHMENT         Y YY
FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT         Y YY
FRAMEBUFFER_INCOMPLETE_DIMENSIONS         Y YY
FRAMEBUFFER_UNSUPPORTED         Y YY
FRAMEBUFFER_BINDING         Y YY
RENDERBUFFER_BINDING         Y YY
MAX_RENDERBUFFER_SIZE         Y YY
INVALID_FRAMEBUFFER_OPERATION         Y YY
UNPACK_FLIP_Y_WEBGL         Y YY
UNPACK_PREMULTIPLY_ALPHA_WEBGL         Y YY
CONTEXT_LOST_WEBGL         Y YY
UNPACK_COLORSPACE_CONVERSION_WEBGL         Y YY
BROWSER_DEFAULT_WEBGL         Y YY

Configuration Document Settings

To use all of the API described for this object, you must ensure the following settings are in your configuration document:

This API does not require a <feature> element to be declared in the configuration document of your BlackBerry WebWorks Application.

Permission Elements (PlayBook and BlackBerry 10+)
This API does not require a <permission> element to be declared in the configuration document of your BlackBerry WebWorks Application.


Functions

void activeTexture
void attachShader
void bindAttribLocation
void bindBuffer
void bindFramebuffer
void bindRenderbuffer
void bindTexture
void blendColor
void blendEquation
void blendEquationSeparate
void blendFunc
void blendFuncSeparate
void bufferData
void bufferData
void bufferData
void bufferSubData
void bufferSubData
GLenum checkFramebufferStatus
void clear
void clearColor
void clearDepth
void clearStencil
void colorMask
void compileShader
void copyTexImage2D
void copyTexSubImage2D
WebGLBuffer createBuffer
WebGLFramebuffer createFramebuffer
WebGLProgram createProgram
WebGLRenderbuffer createRenderbuffer
WebGLShader createShader
WebGLTexture createTexture
void cullFace
void deleteBuffer
void deleteFramebuffer
void deleteProgram
void deleteRenderbuffer
void deleteShader
void deleteTexture
void depthFunc
void depthMask
void depthRange
void detachShader
void disable
void disableVertexAttribArray
void drawArrays
void drawElements
void enable
void enableVertexAttribArray
void finish
void flush
void framebufferRenderbuffer
void framebufferTexture2D
void frontFace
void generateMipmap
WebGLActiveInfo getActiveAttrib
WebGLActiveInfo getActiveUniform
WebGLShader[ ] getAttachedShaders
GLint getAttribLocation
any getBufferParameter
WebGLContextAttributes getContextAttributes
GLenum getError
object getExtension
any getFramebufferAttachmentParameter
any getParameter
String getProgramInfoLog
any getProgramParameter
any getRenderbufferParameter
String getShaderInfoLog
any getShaderParameter
String getShaderSource
String[] getSupportedExtensions
any getTexParameter
any getUniform
WebGLUniformLocation getUniformLocation
any getVertexAttrib
GLsizeiptr getVertexAttribOffset
void hint
GLboolean isBuffer
boolean isContextLost
GLboolean isEnabled
GLboolean isFramebuffer
GLboolean isProgram
GLboolean isRenderbuffer
GLboolean isShader
GLboolean isTexture
void lineWidth
void linkProgram
void pixelStorei
void polygonOffset
void readPixels
void renderbufferStorage
void sampleCoverage
void scissor
void shaderSource
void stencilFunc
void stencilFuncSeparate
void stencilMask
void stencilMaskSeparate
void stencilOp
void stencilOpSeparate
void texImage2D
void texImage2D
void texImage2D
void texImage2D
void texImage2D
void texParameterf
void texParameteri
void texSubImage2D
void texSubImage2D
void texSubImage2D
void texSubImage2D
void texSubImage2D
void uniform1f
void uniform1fv
void uniform1fv
void uniform1i
void uniform1iv
void uniform1iv
void uniform2f
void uniform2fv
void uniform2fv
void uniform2i
void uniform2iv
void uniform2iv
void uniform3f
void uniform3fv
void uniform3fv
void uniform3i
void uniform3iv
void uniform3iv
void uniform4f
void uniform4fv
void uniform4fv
void uniform4i
void uniform4iv
void uniform4iv
void uniformMatrix2fv
void uniformMatrix2fv
void uniformMatrix3fv
void uniformMatrix3fv
void uniformMatrix4fv
void uniformMatrix4fv
void useProgram
void validateProgram
void vertexAttrib1f
void vertexAttrib1fv
void vertexAttrib1fv
void vertexAttrib2f
void vertexAttrib2fv
void vertexAttrib2fv
void vertexAttrib3f
void vertexAttrib3fv
void vertexAttrib3fv
void vertexAttrib4f
void vertexAttrib4fv
void vertexAttrib4fv
void vertexAttribPointer
void viewport

Properties


Constants

GLenum STENCIL_BUFFER_BIT
GLenum COLOR_BUFFER_BIT
GLenum POINTS
GLenum LINES
GLenum LINE_LOOP
GLenum LINE_STRIP
GLenum TRIANGLES
GLenum TRIANGLE_STRIP
GLenum TRIANGLE_FAN
GLenum ZERO
GLenum ONE
GLenum SRC_COLOR
GLenum ONE_MINUS_SRC_COLOR
GLenum SRC_ALPHA
GLenum ONE_MINUS_SRC_ALPHA
GLenum DST_ALPHA
GLenum ONE_MINUS_DST_ALPHA
GLenum DST_COLOR
GLenum ONE_MINUS_DST_COLOR
GLenum SRC_ALPHA_SATURATE
GLenum FUNC_ADD
GLenum BLEND_EQUATION
GLenum BLEND_EQUATION_RGB
GLenum BLEND_EQUATION_ALPHA
GLenum FUNC_SUBTRACT
GLenum FUNC_REVERSE_SUBTRACT
GLenum BLEND_DST_RGB
GLenum BLEND_SRC_RGB
GLenum BLEND_DST_ALPHA
GLenum BLEND_SRC_ALPHA
GLenum CONSTANT_COLOR
GLenum ONE_MINUS_CONSTANT_COLOR
GLenum CONSTANT_ALPHA
GLenum ONE_MINUS_CONSTANT_ALPHA
GLenum BLEND_COLOR
GLenum ARRAY_BUFFER
GLenum ELEMENT_ARRAY_BUFFER
GLenum ARRAY_BUFFER_BINDING
GLenum ELEMENT_ARRAY_BUFFER_BINDING
GLenum STREAM_DRAW
GLenum STATIC_DRAW
GLenum DYNAMIC_DRAW
GLenum BUFFER_SIZE
GLenum BUFFER_USAGE
GLenum CURRENT_VERTEX_ATTRIB
GLenum FRONT
GLenum BACK
GLenum FRONT_AND_BACK
GLenum TEXTURE_2D
GLenum CULL_FACE
GLenum BLEND
GLenum DITHER
GLenum STENCIL_TEST
GLenum DEPTH_TEST
GLenum SCISSOR_TEST
GLenum POLYGON_OFFSET_FILL
GLenum SAMPLE_ALPHA_TO_COVERAGE
GLenum SAMPLE_COVERAGE
GLenum NO_ERROR
GLenum INVALID_ENUM
GLenum INVALID_VALUE
GLenum INVALID_OPERATION
GLenum OUT_OF_MEMORY
GLenum CW
GLenum CCW
GLenum LINE_WIDTH
GLenum ALIASED_POINT_SIZE_RANGE
GLenum ALIASED_LINE_WIDTH_RANGE
GLenum CULL_FACE_MODE
GLenum FRONT_FACE
GLenum DEPTH_RANGE
GLenum DEPTH_WRITEMASK
GLenum DEPTH_CLEAR_VALUE
GLenum DEPTH_FUNC
GLenum STENCIL_CLEAR_VALUE
GLenum STENCIL_FUNC
GLenum STENCIL_FAIL
GLenum STENCIL_PASS_DEPTH_FAIL
GLenum STENCIL_PASS_DEPTH_PASS
GLenum STENCIL_REF
GLenum STENCIL_VALUE_MASK
GLenum STENCIL_WRITEMASK
GLenum STENCIL_BACK_FUNC
GLenum STENCIL_BACK_FAIL
GLenum STENCIL_BACK_PASS_DEPTH_FAIL
GLenum STENCIL_BACK_PASS_DEPTH_PASS
GLenum STENCIL_BACK_REF
GLenum STENCIL_BACK_VALUE_MASK
GLenum STENCIL_BACK_WRITEMASK
GLenum VIEWPORT
GLenum SCISSOR_BOX
GLenum COLOR_CLEAR_VALUE
GLenum COLOR_WRITEMASK
GLenum UNPACK_ALIGNMENT
GLenum PACK_ALIGNMENT
GLenum MAX_TEXTURE_SIZE
GLenum MAX_VIEWPORT_DIMS
GLenum SUBPIXEL_BITS
GLenum RED_BITS
GLenum GREEN_BITS
GLenum BLUE_BITS
GLenum ALPHA_BITS
GLenum DEPTH_BITS
GLenum STENCIL_BITS
GLenum POLYGON_OFFSET_UNITS
GLenum POLYGON_OFFSET_FACTOR
GLenum TEXTURE_BINDING_2D
GLenum SAMPLE_BUFFERS
GLenum SAMPLES
GLenum SAMPLE_COVERAGE_VALUE
GLenum SAMPLE_COVERAGE_INVERT
GLenum NUM_COMPRESSED_TEXTURE_FORMATS
GLenum COMPRESSED_TEXTURE_FORMATS
GLenum DONT_CARE
GLenum FASTEST
GLenum NICEST
GLenum GENERATE_MIPMAP_HINT
GLenum BYTE
GLenum UNSIGNED_BYTE
GLenum SHORT
GLenum UNSIGNED_SHORT
GLenum INT
GLenum UNSIGNED_INT
GLenum FLOAT
GLenum DEPTH_COMPONENT
GLenum ALPHA
GLenum RGB
GLenum RGBA
GLenum LUMINANCE
GLenum LUMINANCE_ALPHA
GLenum UNSIGNED_SHORT_4_4_4_4
GLenum UNSIGNED_SHORT_5_5_5_1
GLenum UNSIGNED_SHORT_5_6_5
GLenum FRAGMENT_SHADER
GLenum VERTEX_SHADER
GLenum MAX_VERTEX_ATTRIBS
GLenum MAX_VERTEX_UNIFORM_VECTORS
GLenum MAX_VARYING_VECTORS
GLenum MAX_COMBINED_TEXTURE_IMAGE_UNITS
GLenum MAX_VERTEX_TEXTURE_IMAGE_UNITS
GLenum MAX_TEXTURE_IMAGE_UNITS
GLenum MAX_FRAGMENT_UNIFORM_VECTORS
GLenum SHADER_TYPE
GLenum DELETE_STATUS
GLenum LINK_STATUS
GLenum VALIDATE_STATUS
GLenum ATTACHED_SHADERS
GLenum ACTIVE_UNIFORMS
GLenum ACTIVE_UNIFORM_MAX_LENGTH
GLenum ACTIVE_ATTRIBUTES
GLenum ACTIVE_ATTRIBUTE_MAX_LENGTH
GLenum SHADING_LANGUAGE_VERSION
GLenum CURRENT_PROGRAM
GLenum NEVER
GLenum LESS
GLenum EQUAL
GLenum LEQUAL
GLenum GREATER
GLenum NOTEQUAL
GLenum GEQUAL
GLenum ALWAYS
GLenum KEEP
GLenum REPLACE
GLenum INCR
GLenum DECR
GLenum INVERT
GLenum INCR_WRAP
GLenum DECR_WRAP
GLenum VENDOR
GLenum RENDERER
GLenum VERSION
GLenum NEAREST
GLenum LINEAR
GLenum NEAREST_MIPMAP_NEAREST
GLenum LINEAR_MIPMAP_NEAREST
GLenum NEAREST_MIPMAP_LINEAR
GLenum LINEAR_MIPMAP_LINEAR
GLenum TEXTURE_MAG_FILTER
GLenum TEXTURE_MIN_FILTER
GLenum TEXTURE_WRAP_S
GLenum TEXTURE_WRAP_T
GLenum TEXTURE
GLenum TEXTURE_CUBE_MAP
GLenum TEXTURE_BINDING_CUBE_MAP
GLenum TEXTURE_CUBE_MAP_POSITIVE_X
GLenum TEXTURE_CUBE_MAP_NEGATIVE_X
GLenum TEXTURE_CUBE_MAP_POSITIVE_Y
GLenum TEXTURE_CUBE_MAP_NEGATIVE_Y
GLenum TEXTURE_CUBE_MAP_POSITIVE_Z
GLenum TEXTURE_CUBE_MAP_NEGATIVE_Z
GLenum MAX_CUBE_MAP_TEXTURE_SIZE
GLenum TEXTURE0
GLenum TEXTURE1
GLenum TEXTURE2
GLenum TEXTURE3
GLenum TEXTURE4
GLenum TEXTURE5
GLenum TEXTURE6
GLenum TEXTURE7
GLenum TEXTURE8
GLenum TEXTURE9
GLenum TEXTURE10
GLenum TEXTURE11
GLenum TEXTURE12
GLenum TEXTURE13
GLenum TEXTURE14
GLenum TEXTURE15
GLenum TEXTURE16
GLenum TEXTURE17
GLenum TEXTURE18
GLenum TEXTURE19
GLenum TEXTURE20
GLenum TEXTURE21
GLenum TEXTURE22
GLenum TEXTURE23
GLenum TEXTURE24
GLenum TEXTURE25
GLenum TEXTURE26
GLenum TEXTURE27
GLenum TEXTURE28
GLenum TEXTURE29
GLenum TEXTURE30
GLenum TEXTURE31
GLenum ACTIVE_TEXTURE
GLenum REPEAT
GLenum CLAMP_TO_EDGE
GLenum MIRRORED_REPEAT
GLenum FLOAT_VEC2
GLenum FLOAT_VEC3
GLenum FLOAT_VEC4
GLenum INT_VEC2
GLenum INT_VEC3
GLenum INT_VEC4
GLenum BOOL
GLenum BOOL_VEC2
GLenum BOOL_VEC3
GLenum BOOL_VEC4
GLenum FLOAT_MAT2
GLenum FLOAT_MAT3
GLenum FLOAT_MAT4
GLenum SAMPLER_2D
GLenum SAMPLER_CUBE
GLenum VERTEX_ATTRIB_ARRAY_ENABLED
GLenum VERTEX_ATTRIB_ARRAY_SIZE
GLenum VERTEX_ATTRIB_ARRAY_STRIDE
GLenum VERTEX_ATTRIB_ARRAY_TYPE
GLenum VERTEX_ATTRIB_ARRAY_NORMALIZED
GLenum VERTEX_ATTRIB_ARRAY_POINTER
GLenum VERTEX_ATTRIB_ARRAY_BUFFER_BINDING
GLenum COMPILE_STATUS
GLenum INFO_LOG_LENGTH
GLenum SHADER_SOURCE_LENGTH
GLenum LOW_FLOAT
GLenum MEDIUM_FLOAT
GLenum HIGH_FLOAT
GLenum LOW_INT
GLenum MEDIUM_INT
GLenum HIGH_INT
GLenum FRAMEBUFFER
GLenum RENDERBUFFER
GLenum RGBA4
GLenum RGB5_A1
GLenum RGB565
GLenum DEPTH_COMPONENT16
GLenum STENCIL_INDEX
GLenum STENCIL_INDEX8
GLenum DEPTH_STENCIL
GLenum RENDERBUFFER_WIDTH
GLenum RENDERBUFFER_HEIGHT
GLenum RENDERBUFFER_INTERNAL_FORMAT
GLenum RENDERBUFFER_RED_SIZE
GLenum RENDERBUFFER_GREEN_SIZE
GLenum RENDERBUFFER_BLUE_SIZE
GLenum RENDERBUFFER_ALPHA_SIZE
GLenum RENDERBUFFER_DEPTH_SIZE
GLenum RENDERBUFFER_STENCIL_SIZE
GLenum FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE
GLenum FRAMEBUFFER_ATTACHMENT_OBJECT_NAME
GLenum FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL
GLenum FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE
GLenum COLOR_ATTACHMENT0
GLenum DEPTH_ATTACHMENT
GLenum STENCIL_ATTACHMENT
GLenum DEPTH_STENCIL_ATTACHMENT
GLenum NONE
GLenum FRAMEBUFFER_COMPLETE
GLenum FRAMEBUFFER_INCOMPLETE_ATTACHMENT
GLenum FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT
GLenum FRAMEBUFFER_INCOMPLETE_DIMENSIONS
GLenum FRAMEBUFFER_UNSUPPORTED
GLenum FRAMEBUFFER_BINDING
GLenum RENDERBUFFER_BINDING
GLenum MAX_RENDERBUFFER_SIZE
GLenum INVALID_FRAMEBUFFER_OPERATION
GLenum UNPACK_FLIP_Y_WEBGL
GLenum UNPACK_PREMULTIPLY_ALPHA_WEBGL
GLenum CONTEXT_LOST_WEBGL
GLenum UNPACK_COLORSPACE_CONVERSION_WEBGL
GLenum BROWSER_DEFAULT_WEBGL

Constructors

canvas.getContext('experimental-webgl')


To create a WebGLRenderingContext object you must fetch the context of a Canvas using the 'experimental-webgl' identifier


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Code Example:
<html>
<head>
    <title>Example</title>
    <script type="text/javascript">
        function foo()
        {
             var canvas = document.getElementById("myCanvas")
             var webgl_context = canvas.getContext('experimental-webgl');      
                
             // Clear the canvas to blue
             webgl_context.viewportWidth = canvas.width;
             webgl_context.viewportHeight = canvas.height;
             webgl_context.clearColor(0.0, 0.0, 1.0, 1.0);
             webgl_context.clear(webgl_context.COLOR_BUFFER_BIT);                
        }
    </script>
    </head>
    <body onload="foo();">
        <canvas id="myCanvas" width="300" height="300"></canvas>
    </body>
</html>

Functions

void activeTexture (texture : GLenum)


Select active texture unit


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
texture Specifies which texture unit to make active. The number of texture units is implementation dependent, but must be at least two. texture must be one of TEXTUREi, where i ranges from 0 to (MAX_COMBINED_TEXTURE_IMAGE_UNITS - 1). The initial value is TEXTURE0.

void attachShader (program : WebGLProgram, shader : WebGLShader)


Attach a shader object to a program object


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
program Specifies the program object to which a shader object will be attached.
shader Specifies the shader object that is to be attached.

void bindAttribLocation (program : WebGLProgram, index : GLuint, name : String)


Associate a generic vertex attribute index with a named attribute variable


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
program Specifies the handle of the program object in which the association is to be made.
index Specifies the index of the generic vertex attribute to be bound.
name Specifies a null terminated string containing the name of the vertex shader attribute variable to which index is to be bound.

void bindBuffer (target : GLenum, buffer : WebGLBuffer)


Bind a named buffer object


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
target Specifies the target to which the buffer object is bound. The symbolic constant must be ARRAY_BUFFER or ELEMENT_ARRAY_BUFFER.
buffer Specifies the name of a buffer object.

void bindFramebuffer (target : GLenum, framebuffer : WebGLFramebuffer)


Bind a named framebuffer object


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
target Specifies the target to which the framebuffer object is bound. The symbolic constant must be FRAMEBUFFER.
framebuffer Specifies the name of a framebuffer object.

void bindRenderbuffer (target : GLenum, renderbuffer : WebGLRenderbuffer)


Bind a named renderbuffer object


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
target Specifies the target to which the renderbuffer object is bound. The symbolic constant must be RENDERBUFFER.
renderbuffer Specifies the name of a renderbuffer object.

void bindTexture (target : GLenum, texture : WebGLTexture)


Bind a named texture to a texturing target


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
target Specifies the target of the active texture unit to which the texture is bound. Must be either TEXTURE_2D or TEXTURE_CUBE_MAP.
texture Specifies the name of a texture.

void blendColor (red : GLclampf, green : GLclampf, blue : GLclampf, alpha : GLclampf)


Set the blend color


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
red specify the red component of BLEND_COLOR
green specify the green component of BLEND_COLOR
blue specify the blue component of BLEND_COLOR
alpha specify the alpha component of BLEND_COLOR

void blendEquation (mode : GLenum)


Specify the equation used for both the RGB blend equation and the Alpha blend equation


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
mode specifies how source and destination colors are combined. It must be FUNC_ADD, FUNC_SUBTRACT, or FUNC_REVERSE_SUBTRACT.

void blendEquationSeparate (modeRGB : GLenum, modeAlpha : GLenum)


Set the RGB blend equation and the alpha blend equation separately


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
modeRGB specifies the RGB blend equation, how the red, green, and blue components of the source and destination colors are combined. It must be FUNC_ADD, FUNC_SUBTRACT, or FUNC_REVERSE_SUBTRACT.
modeAlpha specifies the alpha blend equation, how the alpha component of the source and destination colors are combined. It must be FUNC_ADD, FUNC_SUBTRACT, or FUNC_REVERSE_SUBTRACT.

void blendFunc (sfactor : GLenum, dfactor : GLenum)


Specify pixel arithmetic


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
sfactor Specifies how the red, green, blue, and alpha source blending factors are computed. The following symbolic constants are accepted: ZERO, ONE, SRC_COLOR, ONE_MINUS_SRC_COLOR, DST_COLOR, ONE_MINUS_DST_COLOR, SRC_ALPHA, ONE_MINUS_SRC_ALPHA, DST_ALPHA, ONE_MINUS_DST_ALPHA, CONSTANT_COLOR, ONE_MINUS_CONSTANT_COLOR, CONSTANT_ALPHA, ONE_MINUS_CONSTANT_ALPHA, and SRC_ALPHA_SATURATE. The initial value is ONE.
dfactor Specifies how the red, green, blue, and alpha destination blending factors are computed. The following symbolic constants are accepted: ZERO, ONE, SRC_COLOR, ONE_MINUS_SRC_COLOR, DST_COLOR, ONE_MINUS_DST_COLOR, SRC_ALPHA, ONE_MINUS_SRC_ALPHA, DST_ALPHA, ONE_MINUS_DST_ALPHA. CONSTANT_COLOR, ONE_MINUS_CONSTANT_COLOR, CONSTANT_ALPHA, and ONE_MINUS_CONSTANT_ALPHA. The initial value is ZERO.

void blendFuncSeparate (srcRGB : GLenum, dstRGB : GLenum, srcAlpha : GLenum, dstAlpha : GLenum)


Specify pixel arithmetic for RGB and alpha components separately


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
srcRGB Specifies how the red, green, and blue blending factors are computed. The following symbolic constants are accepted: ZERO, ONE, SRC_COLOR, ONE_MINUS_SRC_COLOR, DST_COLOR, ONE_MINUS_DST_COLOR, SRC_ALPHA, ONE_MINUS_SRC_ALPHA, DST_ALPHA, ONE_MINUS_DST_ALPHA, CONSTANT_COLOR, ONE_MINUS_CONSTANT_COLOR, CONSTANT_ALPHA, ONE_MINUS_CONSTANT_ALPHA, and SRC_ALPHA_SATURATE. The initial value is ONE.
dstRGB Specifies how the red, green, and blue destination blending factors are computed. The following symbolic constants are accepted: ZERO, ONE, SRC_COLOR, ONE_MINUS_SRC_COLOR, DST_COLOR, ONE_MINUS_DST_COLOR, SRC_ALPHA, ONE_MINUS_SRC_ALPHA, DST_ALPHA, ONE_MINUS_DST_ALPHA. CONSTANT_COLOR, ONE_MINUS_CONSTANT_COLOR, CONSTANT_ALPHA, and ONE_MINUS_CONSTANT_ALPHA. The initial value is ZERO.
srcAlpha Specified how the alpha source blending factor is computed. The same symbolic constants are accepted as for srcRGB. The initial value is ONE.
dstAlpha Specified how the alpha destination blending factor is computed. The same symbolic constants are accepted as for dstRGB. The initial value is ZERO.

void bufferData (target : GLenum, size : GLsizeiptr, usage : GLenum)


Set the size of the currently bound WebGLBuffer object for the passed target. The buffer is initialized to 0.


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
target Specifies the target buffer object. The symbolic constant must be ARRAY_BUFFER or ELEMENT_ARRAY_BUFFER.
size Specifies the size in bytes of the buffer object's new data store.
usage Specifies a pointer to data that will be copied into the data store for initialization, or NULL if no data is to be copied.

void bufferData (target : GLenum, data : ArrayBuffer, usage : GLenum)


Set the size of the currently bound WebGLBuffer object for the passed target to the size of the passed data, then write the contents of data to the buffer object.


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
target Specifies the target buffer object. The symbolic constant must be ARRAY_BUFFER or ELEMENT_ARRAY_BUFFER.
data Buffer to measure
usage Specifies a pointer to data that will be copied into the data store for initialization, or NULL if no data is to be copied.

void bufferData (target : GLenum, data : ArrayBufferView, usage : GLenum)


Set the size of the currently bound WebGLBuffer object for the passed target to the size of the passed data, then write the contents of data to the buffer object.


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
target Specifies the target buffer object. The symbolic constant must be ARRAY_BUFFER or ELEMENT_ARRAY_BUFFER.
data Buffer to measure
usage Specifies a pointer to data that will be copied into the data store for initialization, or NULL if no data is to be copied.

void bufferSubData (target : GLenum, offset : GLintptr, data : ArrayBuffer)


Update a subset of a buffer object's data store


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
target Specifies the target buffer object. The symbolic constant must be ARRAY_BUFFER or ELEMENT_ARRAY_BUFFER.
offset Specifies the offset into the buffer object's data store where data replacement will begin, measured in bytes.
data Specifies the size in bytes of the data store region being replaced.

void bufferSubData (target : GLenum, offset : GLintptr, data : ArrayBufferView)


Update a subset of a buffer object's data store


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
target Specifies the target buffer object. The symbolic constant must be ARRAY_BUFFER or ELEMENT_ARRAY_BUFFER.
offset Specifies the offset into the buffer object's data store where data replacement will begin, measured in bytes.
data Specifies the size in bytes of the data store region being replaced.

GLenum checkFramebufferStatus (target : GLenum)


Return the framebuffer completeness status of a framebuffer object


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
target Specifies the target framebuffer object. The symbolic constant must be FRAMEBUFFER.

Return:

symbolic constant that identifies whether or not the currently bound framebuffer is framebuffer complete, and if not, which of the rules of framebuffer completeness is violated


void clear (mask : GLbitfield)


Clear buffers to preset values


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
mask Bitwise OR of masks that indicate the buffers to be cleared. The three masks are COLOR_BUFFER_BIT, DEPTH_BUFFER_BIT, and STENCIL_BUFFER_BIT.

void clearColor (red : GLclampf, green : GLclampf, blue : GLclampf, alpha : GLclampf)


Specify clear values for the color buffers


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
red
green
blue
alpha Specify the red, green, blue, and alpha values used when the color buffers are cleared. The initial values are all 0.

void clearDepth (depth : GLclampf)


Specify the clear value for the depth buffer


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
depth Specifies the depth value used when the depth buffer is cleared. The initial value is 1.

void clearStencil (s : GLint)


Specify the clear value for the stencil buffer


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
s Specifies the index used when the stencil buffer is cleared. The initial value is 0.

void colorMask (red : GLboolean, green : GLboolean, blue : GLboolean, alpha : GLboolean)


Enable and disable writing of frame buffer color components


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
red
green
blue
alpha Specify whether red, green, blue, and alpha can or cannot be written into the frame buffer. The initial values are all TRUE, indicating that the color components can be written.

void compileShader (shader : WebGLShader)


Compile a shader object


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
shader Specifies the shader object to be compiled.

void copyTexImage2D (target : GLenum, level : GLint, internalformat : GLenum, x : GLint, y : GLint, width : GLsizei, height : GLsizei, border : GLint)


Copy pixels into a 2D texture image


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
target Specifies the target texture of the active texture unit. Must be TEXTURE_2D, TEXTURE_CUBE_MAP_POSITIVE_X, TEXTURE_CUBE_MAP_NEGATIVE_X, TEXTURE_CUBE_MAP_POSITIVE_Y, TEXTURE_CUBE_MAP_NEGATIVE_Y, TEXTURE_CUBE_MAP_POSITIVE_Z, or TEXTURE_CUBE_MAP_NEGATIVE_Z.
level Specifies the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image.
internalformat Specifies the internal format of the texture. Must be one of the following symbolic constants: ALPHA, LUMINANCE, LUMINANCE_ALPHA, RGB, or RGBA.
x Specify the x coordinate of the lower left corner of the rectangular region of pixels to be copied.
y Specify the y coordinate of the lower left corner of the rectangular region of pixels to be copied.
width Specifies the width of the texture image. All implementations support 2D texture images that are at least 64 texels wide and cube-mapped texture images that are at least 16 texels wide.
height Specifies the height of the texture image. All implementations support 2D texture images that are at least 64 texels high and cube-mapped texture images that are at least 16 texels high.
border Specifies the width of the border. Must be 0.

void copyTexSubImage2D (target : GLenum, level : GLint, xoffset : GLint, yoffset : GLint, x : GLint, y : GLint, width : GLsizei, height : GLsizei)


Copy a two-dimensional texture subimage


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
target Specifies the target texture of the active texture unit. Must be TEXTURE_2D, TEXTURE_CUBE_MAP_POSITIVE_X, TEXTURE_CUBE_MAP_NEGATIVE_X, TEXTURE_CUBE_MAP_POSITIVE_Y, TEXTURE_CUBE_MAP_NEGATIVE_Y, TEXTURE_CUBE_MAP_POSITIVE_Z, or TEXTURE_CUBE_MAP_NEGATIVE_Z.
level Specifies the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image.
xoffset Specifies a texel offset in the x direction within the texture array.
yoffset Specifies a texel offset in the y direction within the texture array.
x Specify the x coordinate of the lower left corner of the rectangular region of pixels to be copied.
y Specify the y coordinate of the lower left corner of the rectangular region of pixels to be copied.
width Specifies the width of the texture subimage.
height Specifies the height of the texture subimage.

WebGLBuffer createBuffer ()


Create a WebGLBuffer object


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Return:

the created WebGLBuffer object


WebGLFramebuffer createFramebuffer ()


Create a WebGLFramebuffer object


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Return:

the created WebGLFramebuffer object


WebGLProgram createProgram ()


Create a WebGLProgram object


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Return:

the created WebGLProgram object


WebGLRenderbuffer createRenderbuffer ()


Create a WebGLRenderbuffer object


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Return:

the created WebGLRenderbuffer object


WebGLShader createShader (type : GLenum)


Create a WebGLShader object


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
type Specifies the type of shader to be created. Must be either VERTEX_SHADER or FRAGMENT_SHADER.

Return:

the created WebGLShader object


WebGLTexture createTexture ()


Create a WebGLTexture object


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Return:

the created WebGLTexture object


void cullFace (mode : GLenum)


Specify whether front- or back-facing facets can be culled


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
mode Specifies whether front- or back-facing facets are candidates for culling. Symbolic constants FRONT, BACK, and FRONT_AND_BACK are accepted. The initial value is BACK.

void deleteBuffer (buffer : WebGLBuffer)


Delete a buffer object


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
buffer Specifies the buffer object to be deleted.

void deleteFramebuffer (framebuffer : WebGLFramebuffer)


Delete a framebuffer object


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
framebuffer Specifies the framebuffer object to be deleted.

void deleteProgram (program : WebGLProgram)


Delete a program object


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
program Specifies the program object to be deleted.

void deleteRenderbuffer (renderbuffer : WebGLRenderbuffer)


Delete a renderbuffer object


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
renderbuffer Specifies the renderbuffer object to be deleted.

void deleteShader (shader : WebGLShader)


Delete a shader object


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
shader Specifies the shader object to be deleted.

void deleteTexture (texture : WebGLTexture)


Delete a texture object


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
texture Specifies the texture object to be deleted.

void depthFunc (func : GLenum)


Specify the value used for depth buffer comparisons


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
func Specifies the depth comparison function. Symbolic constants NEVER, LESS, EQUAL, LEQUAL, GREATER, NOTEQUAL, GEQUAL, and ALWAYS are accepted. The initial value is LESS.

void depthMask (flag : GLboolean)


Enable or disable writing into the depth buffer


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
flag Specifies whether the depth buffer is enabled for writing. If flag is FALSE, depth buffer writing is disabled. Otherwise, it is enabled. Initially, depth buffer writing is enabled.

void depthRange (zNear : GLclampf, zFar : GLclampf)


Specify mapping of depth values from normalized device coordinates to window coordinates. zNear and zFar values are clamped to the range 0 to 1 and zNear must be less than or equal to zFar


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
zNear Specifies the mapping of the near clipping plane to window coordinates. The initial value is 0.
zFar Specifies the mapping of the far clipping plane to window coordinates. The initial value is 1.

void detachShader (program : WebGLProgram, shader : WebGLShader)


Detach a shader object from a program object


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
program Specifies the program object from which to detach the shader object.
shader Specifies the shader object to be detached.

void disable (cap : GLenum)


Disable server-side GL capabilities


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
cap Specifies a symbolic constant indicating a GL capability. Both enable and disable take a single argument, cap, which can assume one of the following values:
  • WebGLRenderingContext.BLEND
    If enabled, blend the computed fragment color values with the values in the color buffers. See #blendFunc.
  • WebGLRenderingContext.CULL_FACE
    If enabled, cull polygons based on their winding in window coordinates. See #cullFace.
  • WebGLRenderingContext.DEPTH_TEST
    If enabled, do depth comparisons and update the depth buffer. Note that even if the depth buffer exists and the depth mask is non-zero, the depth buffer is not updated if the depth test is disabled. See #depthFunc and #depthRange.
  • WebGLRenderingContext.DITHER
    If enabled, dither color components or indices before they are written to the color buffer.
  • WebGLRenderingContext.POLYGON_OFFSET_FILL
    If enabled, an offset is added to depth values of a polygon's fragments produced by rasterization. See #polygonOffset.
  • WebGLRenderingContext.SAMPLE_ALPHA_TO_COVERAGE
    If enabled, compute a temporary coverage value where each bit is determined by the alpha value at the corresponding sample location. The temporary coverage value is then ANDed with the fragment coverage value.
  • WebGLRenderingContext.SAMPLE_COVERAGE
    If enabled, the fragment's coverage is ANDed with the temporary coverage value. If SAMPLE_COVERAGE_INVERT is set to TRUE, invert the coverage value. See #sampleCoverage.
  • WebGLRenderingContext.SCISSOR_TEST
    If enabled, discard fragments that are outside the scissor rectangle. See #scissor.
  • WebGLRenderingContext.STENCIL_TEST
    If enabled, do stencil testing and update the stencil buffer. See #stencilFunc and #stencilOp.

void disableVertexAttribArray (index : GLuint)


Disables the generic vertex attribute array specified by index


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
index Specifies the index of the generic vertex attribute to be disabled.

void drawArrays (mode : GLenum, first : GLint, count : GLsizei)


Render primitives from vertex array data


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
mode Specifies what kind of primitives to render. Symbolic constants POINTS, LINE_STRIP, LINE_LOOP, LINES, TRIANGLE_STRIP, TRIANGLE_FAN, and TRIANGLES are accepted.
first Specifies the starting index in the enabled arrays.
count Specifies the number of vertices to be rendered.

void drawElements (mode : GLenum, count : GLsizei, type : GLenum, offset : GLintptr)


Render primitives from index array data


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
mode Specifies what kind of primitives to render. Symbolic constants POINTS, LINE_STRIP, LINE_LOOP, LINES, TRIANGLE_STRIP, TRIANGLE_FAN, and TRIANGLES are accepted.
count Specifies the number of elements to be rendered.
type Specifies the type of the values in indices. Must be UNSIGNED_BYTE or UNSIGNED_SHORT.
offset Specifies a pointer to the location where the indices are stored.

void enable (cap : GLenum)


Enable server-side GL capabilities


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
cap Specifies a symbolic constant indicating a GL capability. See @link {#disable} for list of valid constants.

void enableVertexAttribArray (index : GLuint)


Enable a generic vertex attribute array


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
index Specifies the index of the generic vertex attribute to be enabled.

void finish ()


Block until all GL execution is complete


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator

void flush ()


Force execution of GL commands in finite time


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator

void framebufferRenderbuffer (target : GLenum, attachment : GLenum, renderbuffertarget : GLenum, renderbuffer : WebGLRenderbuffer)


Attach a renderbuffer object to a framebuffer object


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
target Specifies the framebuffer target. The symbolic constant must be FRAMEBUFFER.
attachment Specifies the attachment point to which renderbuffer should be attached. Must be one of the following symbolic constants: COLOR_ATTACHMENT0, DEPTH_ATTACHMENT, or STENCIL_ATTACHMENT.
renderbuffertarget Specifies the renderbuffer target. The symbolic constant must be RENDERBUFFER.
renderbuffer Specifies the renderbuffer object that is to be attached.

void framebufferTexture2D (target : GLenum, attachment : GLenum, textarget : GLenum, texture : WebGLTexture, level : GLint)


Attach a texture image to a framebuffer object


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
target Specifies the framebuffer target. The symbolic constant must be FRAMEBUFFER.
attachment Specifies the attachment point to which an image from texture should be attached. Must be one of the following symbolic constants: COLOR_ATTACHMENT0, DEPTH_ATTACHMENT, or STENCIL_ATTACHMENT.
textarget Specifies the texture target. Must be one of the following symbolic constants: TEXTURE_2D, TEXTURE_CUBE_MAP_POSITIVE_X, TEXTURE_CUBE_MAP_NEGATIVE_X, TEXTURE_CUBE_MAP_POSITIVE_Y, TEXTURE_CUBE_MAP_NEGATIVE_Y, TEXTURE_CUBE_MAP_POSITIVE_Z, or TEXTURE_CUBE_MAP_NEGATIVE_Z.
texture Specifies the texture object whose image is to be attached.
level Specifies the mipmap level of the texture image to be attached, which must be 0.

void frontFace (mode : GLenum)


Define front- and back-facing polygons


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
mode Specifies the orientation of front-facing polygons. CW and CCW are accepted. The initial value is CCW.

void generateMipmap (target : GLenum)


Generate a complete set of mipmaps for a texture object


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
target Specifies the texture target of the active texture unit to which the texture object is bound whose mipmaps will be generated. Must be one of the following symbolic constants: TEXTURE_2D or TEXTURE_CUBE_MAP.

WebGLActiveInfo getActiveAttrib (program : WebGLProgram, index : GLuint)


Return information about an active attribute variable


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
program Specifies the program object to be queried.
index Specifies the index of the attribute variable to be queried.

Return:

information about the size, type and name of the vertex attribute at the passed index of the passed program object.


WebGLActiveInfo getActiveUniform (program : WebGLProgram, index : GLuint)


Return information about an active uniform variable


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
program Specifies the program object to be queried.
index Specifies the index of the uniform variable to be queried.

Return:

information about the size, type and name of the uniform at the passed index of the passed program object.


WebGLShader[ ] getAttachedShaders (program : WebGLProgram)


Return the handles of the shader objects attached to a program object


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
program Specifies the program object to be queried.

Return:

the list of shaders attached to the passed program.


GLint getAttribLocation (program : WebGLProgram, name : String)


Return the location of an attribute variable


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
program Specifies the program object to be queried.
name Points to a null terminated string containing the name of the attribute variable whose location is to be queried.

Return:

the index of the generic vertex attribute that is bound to that attribute variable.


any getBufferParameter (target : GLenum, pname : GLenum)


Return parameters of a buffer object


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
target Specifies the target buffer object. The symbolic constant must be ARRAY_BUFFER or ELEMENT_ARRAY_BUFFER.
pname Specifies the symbolic name of a buffer object parameter. Accepted values are BUFFER_SIZE or BUFFER_USAGE.

Return:

the value for the passed pname.


WebGLContextAttributes getContextAttributes ()


Returns the WebGLContextAttributes describing the current drawing buffer


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Return:

The WebGLContextAttributes object describing the current drawing buffer


GLenum getError ()


Return error information


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Return:

The following errors are currently defined:

  • WebGLRenderingContext.NO_ERROR
    No error has been recorded. The value of this symbolic constant is guaranteed to be 0.
  • WebGLRenderingContext.INVALID_ENUM
    An unacceptable value is specified for an enumerated argument. The offending command is ignored and has no other side effect than to set the error flag.
  • WebGLRenderingContext.INVALID_VALUE
    A numeric argument is out of range. The offending command is ignored and has no other side effect than to set the error flag.
  • WebGLRenderingContext.INVALID_OPERATION
    The specified operation is not allowed in the current state. The offending command is ignored and has no other side effect than to set the error flag.
  • WebGLRenderingContext.INVALID_FRAMEBUFFER_OPERATION
    The command is trying to render to or read from the framebuffer while the currently bound framebuffer is not framebuffer complete (i.e. the return value from checkFramebufferStatus is not FRAMEBUFFER_COMPLETE). The offending command is ignored and has no other side effect than to set the error flag.
  • WebGLRenderingContext.OUT_OF_MEMORY
    There is not enough memory left to execute the command. The state of the GL is undefined, except for the state of the error flags, after this error is recorded.
  • WebGLRenderingContext.CONTEXT_LOST_WEBGL
    getError returns CONTEXT_LOST_WEBGL the first time it is called while the context is lost. Afterward it will return NO_ERROR until the context has been restored.


object getExtension (name : String)


Returns an object if the passed extension is supported. The object returned from getExtension contains any constants or functions used by the extension, if any. A returned object may have no constants or functions if the extension does not define any, but a unique object must still be returned. That object is used to indicate that the extension has been enabled


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
name name of extension

Return:

an object if the passed extension is supported, or null if not


any getFramebufferAttachmentParameter (target : GLenum, attachment : GLenum, pname : GLenum)


Return attachment parameters of a framebuffer object


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
target Specifies the target framebuffer object. The symbolic constant must be FRAMEBUFFER.
attachment Specifies the symbolic name of a framebuffer object attachment point. Accepted values are COLOR_ATTACHMENT0, DEPTH_ATTACHMENT, and STENCIL_ATTACHMENT.
pname Specifies the symbolic name of a framebuffer object attachment parameter. Accepted values are FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL, and FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE.

Return:

the value for the passed pname given the passed target and attachment.


any getParameter (pname : GLenum)


Return the value or values of a selected parameter


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
pname Specifies the parameter value to be returned.

Return:

the value for the passed pname. The type returned is the natural type for the requested pname, as given in the following table:

pnamereturned type
ACTIVE_TEXTUREunsigned long
ALIASED_LINE_WIDTH_RANGEFloat32Array (with 2 elements)
ALIASED_POINT_SIZE_RANGEFloat32Array (with 2 elements)
ALPHA_BITSlong
ARRAY_BUFFER_BINDINGWebGLBuffer
BLENDboolean
BLEND_COLORFloat32Array (with 4 values)
BLEND_DST_ALPHAunsigned long
BLEND_DST_RGBunsigned long
BLEND_EQUATION_ALPHAunsigned long
BLEND_EQUATION_RGBunsigned long
BLEND_SRC_ALPHAunsigned long
BLEND_SRC_RGBunsigned long
BLUE_BITSlong
COLOR_CLEAR_VALUEFloat32Array (with 4 values)
COLOR_WRITEMASKboolean[] (with 4 values)
COMPRESSED_TEXTURE_FORMATSnull
CULL_FACEboolean
CULL_FACE_MODEunsigned long
CURRENT_PROGRAMWebGLProgram
DEPTH_BITSlong
DEPTH_CLEAR_VALUEfloat
DEPTH_FUNCunsigned long
DEPTH_RANGEFloat32Array (with 2 elements)
DEPTH_TESTboolean
DEPTH_WRITEMASKboolean
DITHERboolean
ELEMENT_ARRAY_BUFFER_BINDINGWebGLBuffer
FRAMEBUFFER_BINDINGWebGLFramebuffer
FRONT_FACEunsigned long
GENERATE_MIPMAP_HINTunsigned long
GREEN_BITSlong
LINE_WIDTHfloat
MAX_COMBINED_TEXTURE_IMAGE_UNITSlong
MAX_CUBE_MAP_TEXTURE_SIZElong
MAX_FRAGMENT_UNIFORM_VECTORSlong
MAX_RENDERBUFFER_SIZElong
MAX_TEXTURE_IMAGE_UNITSlong
MAX_TEXTURE_SIZElong
MAX_VARYING_VECTORSlong
MAX_VERTEX_ATTRIBSlong
MAX_VERTEX_TEXTURE_IMAGE_UNITSlong
MAX_VERTEX_UNIFORM_VECTORSlong
MAX_VIEWPORT_DIMSInt32Array (with 2 elements)
NUM_COMPRESSED_TEXTURE_FORMATSlong
PACK_ALIGNMENTlong
POLYGON_OFFSET_FACTORfloat
POLYGON_OFFSET_FILLboolean
POLYGON_OFFSET_UNITSfloat
RED_BITSlong
RENDERBUFFER_BINDINGWebGLRenderbuffer
RENDERERString
SAMPLE_BUFFERSlong
SAMPLE_COVERAGE_INVERTboolean
SAMPLE_COVERAGE_VALUEfloat
SAMPLESlong
SCISSOR_BOXInt32Array (with 4 elements)
SCISSOR_TESTboolean
SHADING_LANGUAGE_VERSIONString
STENCIL_BACK_FAILunsigned long
STENCIL_BACK_FUNCunsigned long
STENCIL_BACK_PASS_DEPTH_FAILunsigned long
STENCIL_BACK_PASS_DEPTH_PASSunsigned long
STENCIL_BACK_REFlong
STENCIL_BACK_VALUE_MASKunsigned long
STENCIL_BACK_WRITEMASKunsigned long
STENCIL_BITSlong
STENCIL_CLEAR_VALUElong
STENCIL_FAILunsigned long
STENCIL_FUNCunsigned long
STENCIL_PASS_DEPTH_FAILunsigned long
STENCIL_PASS_DEPTH_PASSunsigned long
STENCIL_REFlong
STENCIL_TESTboolean
STENCIL_VALUE_MASKunsigned long
STENCIL_WRITEMASKunsigned long
SUBPIXEL_BITSlong
TEXTURE_BINDING_2DWebGLTexture
TEXTURE_BINDING_CUBE_MAPWebGLTexture
UNPACK_ALIGNMENTint
UNPACK_COLORSPACE_CONVERSION_WEBGLunsigned long
UNPACK_FLIP_Y_WEBGLboolean
UNPACK_PREMULTIPLY_ALPHA_WEBGLboolean
VENDORString
VERSIONString
VIEWPORTInt32Array (with 4 elements)


String getProgramInfoLog (program : WebGLProgram)


Return the information log for a program object


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
program Specifies the program object whose information log is to be queried.

Return:

the information log for the specified program object.


any getProgramParameter (program : WebGLProgram, pname : GLenum)


Return a parameter from a program object


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
program Specifies the program object to be queried.
pname Specifies the object parameter. Accepted symbolic names are DELETE_STATUS, LINK_STATUS, VALIDATE_STATUS, ATTACHED_SHADERS, ACTIVE_ATTRIBUTES, ACTIVE_UNIFORMS.

Return:

the value for the passed pname given the passed program.


any getRenderbufferParameter (target : GLenum, pname : GLenum)


Return parameters of a renderbuffer object


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
target Specifies the target renderbuffer object. The symbolic constant must be RENDERBUFFER.
pname Specifies the symbolic name of a renderbuffer object parameter. Accepted values are RENDERBUFFER_WIDTH, RENDERBUFFER_HEIGHT, RENDERBUFFER_INTERNAL_FORMAT, RENDERBUFFER_RED_SIZE, RENDERBUFFER_GREEN_SIZE, RENDERBUFFER_BLUE_SIZE, RENDERBUFFER_ALPHA_SIZE, RENDERBUFFER_DEPTH_SIZE, or RENDERBUFFER_STENCIL_SIZE.

Return:

the value for the passed pname given the passed target.


String getShaderInfoLog (shader : WebGLShader)


Return the information log for a shader object


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
shader Specifies the shader object whose information log is to be queried.

Return:

the information log for the specified shader object.


any getShaderParameter (shader : WebGLShader, pname : GLenum)


Return a parameter from a shader object


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
shader Specifies the shader object to be queried.
pname Specifies the object parameter. Accepted symbolic names are SHADER_TYPE, DELETE_STATUS, COMPILE_STATUS.

Return:

the value for the passed pname given the passed shader.


String getShaderSource (shader : WebGLShader)


Return the source code string from a shader object


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
shader Specifies the shader object to be queried.

Return:

the concatenation of the source code strings from the shader object specified by shader.


String[] getSupportedExtensions ()


Returns an array of all the supported extension strings


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Return:

an array of all the supported extension strings


any getTexParameter (target : GLenum, pname : GLenum)


Return texture parameter values


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
target Specifies the symbolic name of the target texture of the active texture unit. TEXTURE_2D and TEXTURE_CUBE_MAP are accepted.
pname Specifies the symbolic name of a texture parameter. TEXTURE_MAG_FILTER, TEXTURE_MIN_FILTER, TEXTURE_WRAP_S, and TEXTURE_WRAP_T are accepted.

Return:

the value of the texture parameter specified as pname.


any getUniform (program : WebGLProgram, location : WebGLUniformLocation)


Return the value of a uniform variable


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
program Specifies the program object to be queried.
location Specifies the location of the uniform variable to be queried.

Return:

the uniform value at the passed location in the passed program. The type returned is dependent on the uniform type, as shown in the following table:

uniform typereturned type
booleanboolean
intlong
floatfloat
vec2Float32Array (with 2 elements)
ivec2Int32Array (with 2 elements)
bvec2boolean[] (with 2 elements)
vec3Float32Array (with 3 elements)
ivec3Int32Array (with 3 elements)
bvec3boolean[] (with 3 elements)
vec4Float32Array (with 4 elements)
ivec4Int32Array (with 4 elements)
bvec4boolean[] (with 4 elements)
mat2Float32Array (with 4 elements)
mat3Float32Array (with 9 elements)
mat4Float32Array (with 16 elements)


WebGLUniformLocation getUniformLocation (program : WebGLProgram, name : String)


Return the location of a uniform variable


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
program Specifies the program object to be queried.
name Points to a null terminated string containing the name of the uniform variable whose location is to be queried.

Return:

an integer that represents the location of a specific uniform variable within a program object.


any getVertexAttrib (index : GLuint, pname : GLenum)


Return a generic vertex attribute parameter


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
index Specifies the generic vertex attribute parameter to be queried.
pname Specifies the symbolic name of the vertex attribute parameter to be queried. Accepted values are VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, VERTEX_ATTRIB_ARRAY_ENABLED, VERTEX_ATTRIB_ARRAY_SIZE, VERTEX_ATTRIB_ARRAY_STRIDE, VERTEX_ATTRIB_ARRAY_TYPE, VERTEX_ATTRIB_ARRAY_NORMALIZED, or CURRENT_VERTEX_ATTRIB.

Return:

the value of a generic vertex attribute parameter.


GLsizeiptr getVertexAttribOffset (index : GLuint, pname : GLenum)


Return the address of the specified generic vertex attribute pointer


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
index Specifies the generic vertex attribute parameter to be returned.
pname Specifies the symbolic name of the generic vertex attribute parameter to be returned. Must be VERTEX_ATTRIB_ARRAY_POINTER.

Return:

the pointer value.


void hint (target : GLenum, mode : GLenum)


Specify implementation-specific hints


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
target Specifies a symbolic constant indicating the behavior to be controlled. GENERATE_MIPMAP_HINT is accepted.
mode Specifies a symbolic constant indicating the desired behavior. FASTEST, NICEST, and DONT_CARE are accepted.

GLboolean isBuffer (buffer : WebGLBuffer)


Determine if a name corresponds to a buffer object


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
buffer Specifies a value that may be the name of a buffer object.

Return:

TRUE if buffer is currently the name of a buffer object. If buffer is zero, or is a non-zero value that is not currently the name of a buffer object, or if an error occurs, isBuffer returns FALSE.


boolean isContextLost ()


Returns true if the context is in the lost state


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Return:

true if the context is in the lost state, false otherwise


GLboolean isEnabled (cap : GLenum)


Test whether a capability is enabled


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
cap Specifies a symbolic constant indicating a GL capability.

Return:

returns WebGLRenderingContext.TRUE if cap is an enabled capability and returns WebGLRenderingContext.FALSE otherwise. Initially all capabilities except DITHER are disabled; DITHER is initially enabled. The following capabilities are accepted for cap:

ConstantSee
BLEND#blendFunc
CULL_FACE#cullFace
DEPTH_TEST#depthFunc, #depthRange
DITHER#enable
POLYGON_OFFSET_FILL#polygonOffset
SAMPLE_ALPHA_TO_COVERAGE#sampleCoverage
SAMPLE_COVERAGE#sampleCoverage
SCISSOR_TEST#scissor
STENCIL_TEST#stencilFunc, #stencilOp


GLboolean isFramebuffer (framebuffer : WebGLFramebuffer)


Determine if a name corresponds to a framebuffer object


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
framebuffer Specifies a value that may be the name of a framebuffer object.

Return:

true if the passed WebGLFramebuffer is valid and false otherwise.


GLboolean isProgram (program : WebGLProgram)


Determine if a name corresponds to a program object


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
program Specifies a potential program object.

Return:

true if the passed WebGLProgram is valid and false otherwise.


GLboolean isRenderbuffer (renderbuffer : WebGLRenderbuffer)


Determine if a name corresponds to a renderbuffer object


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
renderbuffer Specifies a value that may be the name of a renderbuffer object.

Return:

true if the passed WebGLRenderbuffer is valid and false otherwise.


GLboolean isShader (shader : WebGLShader)


Determine if a name corresponds to a shader object


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
shader Specifies a potential shader object.

Return:

true if the passed WebGLShader is valid and false otherwise.


GLboolean isTexture (texture : WebGLTexture)


Determine if a name corresponds to a texture


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
texture Specifies a value that may be the name of a texture.

Return:

true if the passed WebGLTexture is valid and false otherwise.


void lineWidth (width : GLfloat)


Specify the width of rasterized lines


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
width Specifies the width of rasterized lines. The initial value is 1.

void linkProgram (program : WebGLProgram)


Link a program object


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
program Specifies the handle of the program object to be linked.

void pixelStorei (pname : GLenum, param : GLint)


Set pixel storage modes


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
pname Specifies the symbolic name of the parameter to be set. One value affects the packing of pixel data into memory: PACK_ALIGNMENT. The other affects the unpacking of pixel data from memory: UNPACK_ALIGNMENT.
param Specifies the value that pname is set to.

void polygonOffset (factor : GLfloat, units : GLfloat)


Set the scale and units used to calculate depth values


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
factor Specifies a scale factor that is used to create a variable depth offset for each polygon. The initial value is 0.
units Is multiplied by an implementation-specific value to create a constant depth offset. The initial value is 0.

void readPixels (x : GLint, y : GLint, width : GLsizei, height : GLsizei, format : GLenum, type : GLenum, pixels : ArrayBufferView)


Read a block of pixels from the frame buffer


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
x Specify the x coordinate of the first pixel that is read from the frame buffer. This location is the lower left corner of a rectangular block of pixels.
y Specify the y coordinate of the first pixel that is read from the frame buffer. This location is the lower left corner of a rectangular block of pixels.
width Specify the width of the pixel rectangle. Width of one corresponds to a single pixel.
height Specify the height of the pixel rectangle. Height of one corresponds to a single pixel.
format Specifies the format of the pixel data. The following symbolic values are accepted: ALPHA, RGB, and RGBA.
type Specifies the data type of the pixel data. Must be one of UNSIGNED_BYTE, UNSIGNED_SHORT_5_6_5, UNSIGNED_SHORT_4_4_4_4, or UNSIGNED_SHORT_5_5_5_1.
pixels Returns the pixel data.

void renderbufferStorage (target : GLenum, internalformat : GLenum, width : GLsizei, height : GLsizei)


Create and initialize a renderbuffer object's data store


Supported Platforms
 - BlackBerry PlayBook 2.0
 - BlackBerry 10
 - Ripple Emulator


Parameters
target Specifies the renderbuffer target. The symbolic constant must be RENDERBUFFER.
internalformat Specifies the color-renderable, depth-renderable, or stencil-renderable format of the renderbuffer. Must be one of the following symbolic constants: RGBA4, RGB565, RGB5_A1, DEPTH_COMPONENT16, or STENCIL_INDEX8.
width Specifies the width of the renderbuffer in pixels.
height Specifies the height of the renderbuffer in pixels.

void sampleCoverage (value : GLclampf, invert : GLboolean)