RenderingContext
The WebGLRenderingContext interface provides the OpenGL ES 2.0 rendering context for the drawing surface of an HTML canvas element.
Documentation WebGLRenderingContext by Mozilla Contributors, licensed under CC-BY-SA 2.5.
Static Members
DEPTH_BUFFER_BIT: IntSTENCIL_BUFFER_BIT: IntCOLOR_BUFFER_BIT: IntPOINTS: IntLINES: IntLINE_LOOP: IntLINE_STRIP: IntTRIANGLES: IntTRIANGLE_STRIP: IntTRIANGLE_FAN: IntZERO: IntONE: IntSRC_COLOR: IntONE_MINUS_SRC_COLOR: IntSRC_ALPHA: IntONE_MINUS_SRC_ALPHA: IntDST_ALPHA: IntONE_MINUS_DST_ALPHA: IntDST_COLOR: IntONE_MINUS_DST_COLOR: IntSRC_ALPHA_SATURATE: IntFUNC_ADD: IntBLEND_EQUATION: IntBLEND_EQUATION_RGB: IntBLEND_EQUATION_ALPHA: IntFUNC_SUBTRACT: IntFUNC_REVERSE_SUBTRACT: IntBLEND_DST_RGB: IntBLEND_SRC_RGB: IntBLEND_DST_ALPHA: IntBLEND_SRC_ALPHA: IntCONSTANT_COLOR: IntONE_MINUS_CONSTANT_COLOR: IntCONSTANT_ALPHA: IntONE_MINUS_CONSTANT_ALPHA: IntBLEND_COLOR: IntARRAY_BUFFER: IntELEMENT_ARRAY_BUFFER: IntARRAY_BUFFER_BINDING: IntELEMENT_ARRAY_BUFFER_BINDING: IntSTREAM_DRAW: IntSTATIC_DRAW: IntDYNAMIC_DRAW: IntBUFFER_SIZE: IntBUFFER_USAGE: IntCURRENT_VERTEX_ATTRIB: IntFRONT: IntBACK: IntFRONT_AND_BACK: IntCULL_FACE: IntBLEND: IntDITHER: IntSTENCIL_TEST: IntDEPTH_TEST: IntSCISSOR_TEST: IntPOLYGON_OFFSET_FILL: IntSAMPLE_ALPHA_TO_COVERAGE: IntSAMPLE_COVERAGE: IntNO_ERROR: IntINVALID_ENUM: IntINVALID_VALUE: IntINVALID_OPERATION: IntOUT_OF_MEMORY: IntCW: IntCCW: IntLINE_WIDTH: IntALIASED_POINT_SIZE_RANGE: IntALIASED_LINE_WIDTH_RANGE: IntCULL_FACE_MODE: IntFRONT_FACE: IntDEPTH_RANGE: IntDEPTH_WRITEMASK: IntDEPTH_CLEAR_VALUE: IntDEPTH_FUNC: IntSTENCIL_CLEAR_VALUE: IntSTENCIL_FUNC: IntSTENCIL_FAIL: IntSTENCIL_PASS_DEPTH_FAIL: IntSTENCIL_PASS_DEPTH_PASS: IntSTENCIL_REF: IntSTENCIL_VALUE_MASK: IntSTENCIL_WRITEMASK: IntSTENCIL_BACK_FUNC: IntSTENCIL_BACK_FAIL: IntSTENCIL_BACK_PASS_DEPTH_FAIL: IntSTENCIL_BACK_PASS_DEPTH_PASS: IntSTENCIL_BACK_REF: IntSTENCIL_BACK_VALUE_MASK: IntSTENCIL_BACK_WRITEMASK: IntVIEWPORT: IntSCISSOR_BOX: IntCOLOR_CLEAR_VALUE: IntCOLOR_WRITEMASK: IntUNPACK_ALIGNMENT: IntPACK_ALIGNMENT: IntMAX_TEXTURE_SIZE: IntMAX_VIEWPORT_DIMS: IntSUBPIXEL_BITS: IntRED_BITS: IntGREEN_BITS: IntBLUE_BITS: IntALPHA_BITS: IntDEPTH_BITS: IntSTENCIL_BITS: IntPOLYGON_OFFSET_UNITS: IntPOLYGON_OFFSET_FACTOR: IntTEXTURE_BINDING_2D: IntSAMPLE_BUFFERS: IntSAMPLES: IntSAMPLE_COVERAGE_VALUE: IntSAMPLE_COVERAGE_INVERT: IntCOMPRESSED_TEXTURE_FORMATS: IntDONT_CARE: IntFASTEST: IntNICEST: IntGENERATE_MIPMAP_HINT: IntBYTE: IntUNSIGNED_BYTE: IntSHORT: IntUNSIGNED_SHORT: IntINT: IntUNSIGNED_INT: IntFLOAT: IntDEPTH_COMPONENT: IntALPHA: IntRGB: IntRGBA: IntLUMINANCE: IntLUMINANCE_ALPHA: IntUNSIGNED_SHORT_4_4_4_4: IntUNSIGNED_SHORT_5_5_5_1: IntUNSIGNED_SHORT_5_6_5: IntFRAGMENT_SHADER: IntVERTEX_SHADER: IntMAX_VERTEX_ATTRIBS: IntMAX_VERTEX_UNIFORM_VECTORS: IntMAX_VARYING_VECTORS: IntMAX_COMBINED_TEXTURE_IMAGE_UNITS: IntMAX_VERTEX_TEXTURE_IMAGE_UNITS: IntMAX_TEXTURE_IMAGE_UNITS: IntMAX_FRAGMENT_UNIFORM_VECTORS: IntSHADER_TYPE: IntDELETE_STATUS: IntLINK_STATUS: IntVALIDATE_STATUS: IntATTACHED_SHADERS: IntACTIVE_UNIFORMS: IntACTIVE_ATTRIBUTES: IntSHADING_LANGUAGE_VERSION: IntCURRENT_PROGRAM: IntNEVER: IntLESS: IntEQUAL: IntLEQUAL: IntGREATER: IntNOTEQUAL: IntGEQUAL: IntALWAYS: IntKEEP: IntREPLACE: IntINCR: IntDECR: IntINVERT: IntINCR_WRAP: IntDECR_WRAP: IntVENDOR: IntRENDERER: IntVERSION: IntNEAREST: IntLINEAR: IntNEAREST_MIPMAP_NEAREST: IntLINEAR_MIPMAP_NEAREST: IntNEAREST_MIPMAP_LINEAR: IntLINEAR_MIPMAP_LINEAR: IntTEXTURE_MAG_FILTER: IntTEXTURE_MIN_FILTER: IntTEXTURE_WRAP_S: IntTEXTURE_WRAP_T: IntTEXTURE_2D: IntTEXTURE: IntTEXTURE_CUBE_MAP: IntTEXTURE_BINDING_CUBE_MAP: IntTEXTURE_CUBE_MAP_POSITIVE_X: IntTEXTURE_CUBE_MAP_NEGATIVE_X: IntTEXTURE_CUBE_MAP_POSITIVE_Y: IntTEXTURE_CUBE_MAP_NEGATIVE_Y: IntTEXTURE_CUBE_MAP_POSITIVE_Z: IntTEXTURE_CUBE_MAP_NEGATIVE_Z: IntMAX_CUBE_MAP_TEXTURE_SIZE: IntTEXTURE0: IntTEXTURE1: IntTEXTURE2: IntTEXTURE3: IntTEXTURE4: IntTEXTURE5: IntTEXTURE6: IntTEXTURE7: IntTEXTURE8: IntTEXTURE9: IntTEXTURE10: IntTEXTURE11: IntTEXTURE12: IntTEXTURE13: IntTEXTURE14: IntTEXTURE15: IntTEXTURE16: IntTEXTURE17: IntTEXTURE18: IntTEXTURE19: IntTEXTURE20: IntTEXTURE21: IntTEXTURE22: IntTEXTURE23: IntTEXTURE24: IntTEXTURE25: IntTEXTURE26: IntTEXTURE27: IntTEXTURE28: IntTEXTURE29: IntTEXTURE30: IntTEXTURE31: IntACTIVE_TEXTURE: IntREPEAT: IntCLAMP_TO_EDGE: IntMIRRORED_REPEAT: IntFLOAT_VEC2: IntFLOAT_VEC3: IntFLOAT_VEC4: IntINT_VEC2: IntINT_VEC3: IntINT_VEC4: IntBOOL: IntBOOL_VEC2: IntBOOL_VEC3: IntBOOL_VEC4: IntFLOAT_MAT2: IntFLOAT_MAT3: IntFLOAT_MAT4: IntSAMPLER_2D: IntSAMPLER_CUBE: IntVERTEX_ATTRIB_ARRAY_ENABLED: IntVERTEX_ATTRIB_ARRAY_SIZE: IntVERTEX_ATTRIB_ARRAY_STRIDE: IntVERTEX_ATTRIB_ARRAY_TYPE: IntVERTEX_ATTRIB_ARRAY_NORMALIZED: IntVERTEX_ATTRIB_ARRAY_POINTER: IntVERTEX_ATTRIB_ARRAY_BUFFER_BINDING: IntIMPLEMENTATION_COLOR_READ_TYPE: IntIMPLEMENTATION_COLOR_READ_FORMAT: IntCOMPILE_STATUS: IntLOW_FLOAT: IntMEDIUM_FLOAT: IntHIGH_FLOAT: IntLOW_INT: IntMEDIUM_INT: IntHIGH_INT: IntFRAMEBUFFER: IntRENDERBUFFER: IntRGBA4: IntRGB5_A1: IntRGB565: IntDEPTH_COMPONENT16: IntSTENCIL_INDEX8: IntDEPTH_STENCIL: IntRENDERBUFFER_WIDTH: IntRENDERBUFFER_HEIGHT: IntRENDERBUFFER_INTERNAL_FORMAT: IntRENDERBUFFER_RED_SIZE: IntRENDERBUFFER_GREEN_SIZE: IntRENDERBUFFER_BLUE_SIZE: IntRENDERBUFFER_ALPHA_SIZE: IntRENDERBUFFER_DEPTH_SIZE: IntRENDERBUFFER_STENCIL_SIZE: IntFRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: IntFRAMEBUFFER_ATTACHMENT_OBJECT_NAME: IntFRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: IntFRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: IntCOLOR_ATTACHMENT0: IntDEPTH_ATTACHMENT: IntSTENCIL_ATTACHMENT: IntDEPTH_STENCIL_ATTACHMENT: IntNONE: IntFRAMEBUFFER_COMPLETE: IntFRAMEBUFFER_INCOMPLETE_ATTACHMENT: IntFRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: IntFRAMEBUFFER_INCOMPLETE_DIMENSIONS: IntFRAMEBUFFER_UNSUPPORTED: IntFRAMEBUFFER_BINDING: IntRENDERBUFFER_BINDING: IntMAX_RENDERBUFFER_SIZE: IntINVALID_FRAMEBUFFER_OPERATION: IntUNPACK_FLIP_Y_WEBGL: IntUNPACK_PREMULTIPLY_ALPHA_WEBGL: IntCONTEXT_LOST_WEBGL: IntUNPACK_COLORSPACE_CONVERSION_WEBGL: IntBROWSER_DEFAULT_WEBGL: IntInstance Members
canvas: js.html.CanvasElementA read-only back-reference to the HTMLCanvasElement. Might be null if it is not associated with a canvas element.
drawingBufferWidth: IntThe read-only width of the current drawing buffer. Should match the width of the canvas element associated with this context.
drawingBufferHeight: IntThe read-only height of the current drawing buffer. Should match the height of the canvas element associated with this context.
bufferData(target: Int, data: js.lib.ArrayBufferView, usage: Int): VoidUpdates buffer data.
| Name | Type |
|---|---|
target |
Int |
data |
js.lib.ArrayBufferView |
usage |
Int |
bufferSubData(target: Int, offset: Int, data: js.lib.ArrayBufferView): VoidUpdates buffer data starting at a passed offset.
| Name | Type |
|---|---|
target |
Int |
offset |
Int |
data |
js.lib.ArrayBufferView |
compressedTexImage2D(target: Int, level: Int, internalformat: Int, width: Int, height: Int, border: Int, data: js.lib.ArrayBufferView): VoidSpecifies a 2D texture image in a compressed format.
| Name | Type |
|---|---|
target |
Int |
level |
Int |
internalformat |
Int |
width |
Int |
height |
Int |
border |
Int |
data |
js.lib.ArrayBufferView |
compressedTexSubImage2D(target: Int, level: Int, xoffset: Int, yoffset: Int, width: Int, height: Int, format: Int, data: js.lib.ArrayBufferView): VoidSpecifies a 2D texture sub-image in a compressed format.
| Name | Type |
|---|---|
target |
Int |
level |
Int |
xoffset |
Int |
yoffset |
Int |
width |
Int |
height |
Int |
format |
Int |
data |
js.lib.ArrayBufferView |
readPixels(x: Int, y: Int, width: Int, height: Int, format: Int, type: Int, pixels: js.lib.ArrayBufferView): VoidReads a block of pixels from the WebGLFrameBuffer.
| Name | Type |
|---|---|
x |
Int |
y |
Int |
width |
Int |
height |
Int |
format |
Int |
type |
Int |
pixels |
js.lib.ArrayBufferView |
texImage2D(target: Int, level: Int, internalformat: Int, format: Int, type: Int, video: js.html.VideoElement): VoidSpecifies a 2D texture image.
| Name | Type |
|---|---|
target |
Int |
level |
Int |
internalformat |
Int |
format |
Int |
type |
Int |
video |
js.html.VideoElement |
texSubImage2D(target: Int, level: Int, xoffset: Int, yoffset: Int, format: Int, type: Int, video: js.html.VideoElement): VoidUpdates a sub-rectangle of the current WebGLTexture.
| Name | Type |
|---|---|
target |
Int |
level |
Int |
xoffset |
Int |
yoffset |
Int |
format |
Int |
type |
Int |
video |
js.html.VideoElement |
uniform1fv(location: UniformLocation, data: js.lib.Float32Array): Void| Name | Type |
|---|---|
location |
UniformLocation |
data |
js.lib.Float32Array |
uniform2fv(location: UniformLocation, data: js.lib.Float32Array): Void| Name | Type |
|---|---|
location |
UniformLocation |
data |
js.lib.Float32Array |
uniform3fv(location: UniformLocation, data: js.lib.Float32Array): Void| Name | Type |
|---|---|
location |
UniformLocation |
data |
js.lib.Float32Array |
uniform4fv(location: UniformLocation, data: js.lib.Float32Array): Void| Name | Type |
|---|---|
location |
UniformLocation |
data |
js.lib.Float32Array |
uniform1iv(location: UniformLocation, data: js.lib.Int32Array): Void| Name | Type |
|---|---|
location |
UniformLocation |
data |
js.lib.Int32Array |
uniform2iv(location: UniformLocation, data: js.lib.Int32Array): Void| Name | Type |
|---|---|
location |
UniformLocation |
data |
js.lib.Int32Array |
uniform3iv(location: UniformLocation, data: js.lib.Int32Array): Void| Name | Type |
|---|---|
location |
UniformLocation |
data |
js.lib.Int32Array |
uniform4iv(location: UniformLocation, data: js.lib.Int32Array): Void| Name | Type |
|---|---|
location |
UniformLocation |
data |
js.lib.Int32Array |
uniformMatrix2fv(location: UniformLocation, transpose: Bool, data: js.lib.Float32Array): Void| Name | Type |
|---|---|
location |
UniformLocation |
transpose |
Bool |
data |
js.lib.Float32Array |
uniformMatrix3fv(location: UniformLocation, transpose: Bool, data: js.lib.Float32Array): Void| Name | Type |
|---|---|
location |
UniformLocation |
transpose |
Bool |
data |
js.lib.Float32Array |
uniformMatrix4fv(location: UniformLocation, transpose: Bool, data: js.lib.Float32Array): Void| Name | Type |
|---|---|
location |
UniformLocation |
transpose |
Bool |
data |
js.lib.Float32Array |
getContextAttributes(): ContextAttributesReturns a WebGLContextAttributes object that contains the actual context parameters. Might return null, if the context is lost.
| Returns |
|---|
| ContextAttributes |
isContextLost(): BoolReturns true if the context is lost, otherwise returns false.
| Returns |
|---|
| Bool |
Returns an Array of DOMString elements with all the supported WebGL extensions.
| Returns |
|---|
| Array<String> |
getExtension(name: Extension<getExtension.T>): getExtension.TReturns an extension object.
| Name | Type |
|---|---|
name |
Extension<getExtension.T> |
| Returns |
|---|
| getExtension.T |
Selects the active texture unit.
| Name | Type |
|---|---|
texture |
Int |
Attaches a WebGLShader to a WebGLProgram.
| Name | Type |
|---|---|
program |
Program |
shader |
Shader |
Binds a generic vertex index to a named attribute variable.
| Name | Type |
|---|---|
program |
Program |
index |
Int |
name |
String |
Binds a WebGLBuffer object to a given target.
| Name | Type |
|---|---|
target |
Int |
buffer |
Buffer |
bindFramebuffer(target: Int, framebuffer: Framebuffer): VoidBinds a WebGLFrameBuffer object to a given target.
| Name | Type |
|---|---|
target |
Int |
framebuffer |
Framebuffer |
bindRenderbuffer(target: Int, renderbuffer: Renderbuffer): VoidBinds a WebGLRenderBuffer object to a given target.
| Name | Type |
|---|---|
target |
Int |
renderbuffer |
Renderbuffer |
Binds a WebGLTexture object to a given target.
| Name | Type |
|---|---|
target |
Int |
texture |
Texture |
Sets the source and destination blending factors.
| Name | Type |
|---|---|
red |
Float |
green |
Float |
blue |
Float |
alpha |
Float |
Sets both the RGB blend equation and alpha blend equation to a single equation.
| Name | Type |
|---|---|
mode |
Int |
Sets the RGB blend equation and alpha blend equation separately.
| Name | Type |
|---|---|
modeRGB |
Int |
modeAlpha |
Int |
Defines which function is used for blending pixel arithmetic.
| Name | Type |
|---|---|
sfactor |
Int |
dfactor |
Int |
Defines which function is used for blending pixel arithmetic for RGB and alpha components separately.
| Name | Type |
|---|---|
srcRGB |
Int |
dstRGB |
Int |
srcAlpha |
Int |
dstAlpha |
Int |
Returns the status of the framebuffer.
| Name | Type |
|---|---|
target |
Int |
| Returns |
|---|
| Int |
Clears specified buffers to preset values.
| Name | Type |
|---|---|
mask |
Int |
Specifies the color values used when clearing color buffers.
| Name | Type |
|---|---|
red |
Float |
green |
Float |
blue |
Float |
alpha |
Float |
Specifies the depth value used when clearing the depth buffer.
| Name | Type |
|---|---|
depth |
Float |
Specifies the stencil value used when clearing the stencil buffer.
| Name | Type |
|---|---|
s |
Int |
Sets which color components to enable or to disable when drawing or rendering to a WebGLFramebuffer.
| Name | Type |
|---|---|
red |
Bool |
green |
Bool |
blue |
Bool |
alpha |
Bool |
Compiles a WebGLShader.
| Name | Type |
|---|---|
shader |
Shader |
copyTexImage2D(target: Int, level: Int, internalformat: Int, x: Int, y: Int, width: Int, height: Int, border: Int): VoidCopies a 2D texture image.
| Name | Type |
|---|---|
target |
Int |
level |
Int |
internalformat |
Int |
x |
Int |
y |
Int |
width |
Int |
height |
Int |
border |
Int |
copyTexSubImage2D(target: Int, level: Int, xoffset: Int, yoffset: Int, x: Int, y: Int, width: Int, height: Int): VoidCopies a 2D texture sub-image.
| Name | Type |
|---|---|
target |
Int |
level |
Int |
xoffset |
Int |
yoffset |
Int |
x |
Int |
y |
Int |
width |
Int |
height |
Int |
createBuffer(): BufferCreates a WebGLBuffer object.
| Returns |
|---|
| Buffer |
createFramebuffer(): FramebufferCreates a WebGLFrameBuffer object.
| Returns |
|---|
| Framebuffer |
createProgram(): ProgramCreates a WebGLProgram.
| Returns |
|---|
| Program |
createRenderbuffer(): RenderbufferCreates a WebGLRenderBuffer object.
| Returns |
|---|
| Renderbuffer |
Creates a WebGLShader.
| Name | Type |
|---|---|
type |
Int |
| Returns |
|---|
| Shader |
createTexture(): TextureCreates a WebGLTexture object.
| Returns |
|---|
| Texture |
Specifies whether or not front- and/or back-facing polygons can be culled.
| Name | Type |
|---|---|
mode |
Int |
Deletes a WebGLBuffer object.
| Name | Type |
|---|---|
buffer |
Buffer |
deleteFramebuffer(framebuffer: Framebuffer): VoidDeletes a WebGLFrameBuffer object.
| Name | Type |
|---|---|
framebuffer |
Framebuffer |
Deletes a WebGLProgram.
| Name | Type |
|---|---|
program |
Program |
deleteRenderbuffer(renderbuffer: Renderbuffer): VoidDeletes a WebGLRenderBuffer object.
| Name | Type |
|---|---|
renderbuffer |
Renderbuffer |
Deletes a WebGLShader.
| Name | Type |
|---|---|
shader |
Shader |
Deletes a WebGLTexture object.
| Name | Type |
|---|---|
texture |
Texture |
Specifies a function that compares incoming pixel depth to the current depth buffer value.
| Name | Type |
|---|---|
func |
Int |
Sets whether writing into the depth buffer is enabled or disabled.
| Name | Type |
|---|---|
flag |
Bool |
Specifies the depth range mapping from normalized device coordinates to window or viewport coordinates.
| Name | Type |
|---|---|
zNear |
Float |
zFar |
Float |
Detaches a WebGLShader.
| Name | Type |
|---|---|
program |
Program |
shader |
Shader |
Disables specific WebGL capabilities for this context.
| Name | Type |
|---|---|
cap |
Int |
Disables a vertex attribute array at a given position.
| Name | Type |
|---|---|
index |
Int |
Renders primitives from array data.
| Name | Type |
|---|---|
mode |
Int |
first |
Int |
count |
Int |
Renders primitives from element array data.
| Name | Type |
|---|---|
mode |
Int |
count |
Int |
type |
Int |
offset |
Int |
Enables specific WebGL capabilities for this context.
| Name | Type |
|---|---|
cap |
Int |
Enables a vertex attribute array at a given position.
| Name | Type |
|---|---|
index |
Int |
finish(): VoidBlocks execution until all previously called commands are finished.
flush(): VoidEmpties different buffer commands, causing all commands to be executed as quickly as possible.
framebufferRenderbuffer(target: Int, attachment: Int, renderbuffertarget: Int, renderbuffer: Renderbuffer): VoidAttaches a WebGLRenderingBuffer object to a WebGLFrameBuffer object.
| Name | Type |
|---|---|
target |
Int |
attachment |
Int |
renderbuffertarget |
Int |
renderbuffer |
Renderbuffer |
framebufferTexture2D(target: Int, attachment: Int, textarget: Int, texture: Texture, level: Int): VoidAttaches a textures image to a WebGLFrameBuffer object.
| Name | Type |
|---|---|
target |
Int |
attachment |
Int |
textarget |
Int |
texture |
Texture |
level |
Int |
Specifies whether polygons are front- or back-facing by setting a winding orientation.
| Name | Type |
|---|---|
mode |
Int |
Generates a set of mipmaps for a WebGLTexture object.
| Name | Type |
|---|---|
target |
Int |
getActiveAttrib(program: Program, index: Int): ActiveInfoReturns information about an active attribute variable.
| Name | Type |
|---|---|
program |
Program |
index |
Int |
| Returns |
|---|
| ActiveInfo |
getActiveUniform(program: Program, index: Int): ActiveInfoReturns information about an active uniform variable.
| Name | Type |
|---|---|
program |
Program |
index |
Int |
| Returns |
|---|
| ActiveInfo |
Returns a list of WebGLShader objects attached to a WebGLProgram.
| Name | Type |
|---|---|
program |
Program |
| Returns |
|---|
| Array<Shader> |
Returns the location of an attribute variable.
| Name | Type |
|---|---|
program |
Program |
name |
String |
| Returns |
|---|
| Int |
Returns information about the buffer.
| Name | Type |
|---|---|
target |
Int |
pname |
Int |
| Returns |
|---|
| Dynamic |
Returns a value for the passed parameter name.
| Name | Type |
|---|---|
pname |
Int |
| Returns |
|---|
| Dynamic |
getError(): IntReturns error information.
| Returns |
|---|
| Int |
Returns information about the framebuffer.
| Name | Type |
|---|---|
target |
Int |
attachment |
Int |
pname |
Int |
| Returns |
|---|
| Dynamic |
Returns information about the program.
| Name | Type |
|---|---|
program |
Program |
pname |
Int |
| Returns |
|---|
| Dynamic |
Returns the information log for a WebGLProgram object.
| Name | Type |
|---|---|
program |
Program |
| Returns |
|---|
| String |
Returns information about the renderbuffer.
| Name | Type |
|---|---|
target |
Int |
pname |
Int |
| Returns |
|---|
| Dynamic |
Returns information about the shader.
| Name | Type |
|---|---|
shader |
Shader |
pname |
Int |
| Returns |
|---|
| Dynamic |
getShaderPrecisionFormat(shadertype: Int, precisiontype: Int): ShaderPrecisionFormatReturns a WebGLShaderPrecisionFormat object describing the precision for the numeric format of the shader.
| Name | Type |
|---|---|
shadertype |
Int |
precisiontype |
Int |
| Returns |
|---|
| ShaderPrecisionFormat |
Returns the information log for a WebGLShader object.
| Name | Type |
|---|---|
shader |
Shader |
| Returns |
|---|
| String |
Returns the source code of a WebGLShader as a string.
| Name | Type |
|---|---|
shader |
Shader |
| Returns |
|---|
| String |
Returns information about the texture.
| Name | Type |
|---|---|
target |
Int |
pname |
Int |
| Returns |
|---|
| Dynamic |
getUniform(program: Program, location: UniformLocation): DynamicReturns the value of a uniform variable at a given location.
| Name | Type |
|---|---|
program |
Program |
location |
UniformLocation |
| Returns |
|---|
| Dynamic |
getUniformLocation(program: Program, name: String): UniformLocationReturns the location of a uniform variable.
| Name | Type |
|---|---|
program |
Program |
name |
String |
| Returns |
|---|
| UniformLocation |
Returns information about a vertex attribute at a given position.
| Name | Type |
|---|---|
index |
Int |
pname |
Int |
| Returns |
|---|
| Dynamic |
Returns the address of a given vertex attribute.
| Name | Type |
|---|---|
index |
Int |
pname |
Int |
| Returns |
|---|
| Int |
Specifies hints for certain behaviors. The interpretation of these hints depend on the implementation.
| Name | Type |
|---|---|
target |
Int |
mode |
Int |
Returns a Boolean indicating if the passed buffer is valid.
| Name | Type |
|---|---|
buffer |
Buffer |
| Returns |
|---|
| Bool |
Tests whether a specific WebGL capability is enabled or not for this context.
| Name | Type |
|---|---|
cap |
Int |
| Returns |
|---|
| Bool |
isFramebuffer(framebuffer: Framebuffer): BoolReturns a Boolean indicating if the passed WebGLFrameBuffer object is valid.
| Name | Type |
|---|---|
framebuffer |
Framebuffer |
| Returns |
|---|
| Bool |
Returns a Boolean indicating if the passed WebGLProgram is valid.
| Name | Type |
|---|---|
program |
Program |
| Returns |
|---|
| Bool |
isRenderbuffer(renderbuffer: Renderbuffer): BoolReturns a Boolean indicating if the passed WebGLRenderingBuffer is valid.
| Name | Type |
|---|---|
renderbuffer |
Renderbuffer |
| Returns |
|---|
| Bool |
Returns a Boolean indicating if the passed WebGLShader is valid.
| Name | Type |
|---|---|
shader |
Shader |
| Returns |
|---|
| Bool |
Returns a Boolean indicating if the passed WebGLTexture is valid.
| Name | Type |
|---|---|
texture |
Texture |
| Returns |
|---|
| Bool |
Sets the line width of rasterized lines.
| Name | Type |
|---|---|
width |
Float |
Links the passed WebGLProgram object.
| Name | Type |
|---|---|
program |
Program |
Specifies the pixel storage modes
| Name | Type |
|---|---|
pname |
Int |
param |
Int |
Specifies the scale factors and units to calculate depth values.
| Name | Type |
|---|---|
factor |
Float |
units |
Float |
Creates a renderbuffer data store.
| Name | Type |
|---|---|
target |
Int |
internalformat |
Int |
width |
Int |
height |
Int |
Specifies multi-sample coverage parameters for anti-aliasing effects.
| Name | Type |
|---|---|
value |
Float |
invert |
Bool |
Defines the scissor box.
| Name | Type |
|---|---|
x |
Int |
y |
Int |
width |
Int |
height |
Int |
Sets the source code in a WebGLShader.
| Name | Type |
|---|---|
shader |
Shader |
source |
String |
Sets the both front and back function and reference value for stencil testing.
| Name | Type |
|---|---|
func |
Int |
ref |
Int |
mask |
Int |
Sets the front and/or back function and reference value for stencil testing.
| Name | Type |
|---|---|
face |
Int |
func |
Int |
ref |
Int |
mask |
Int |
Controls enabling and disabling of both the front and back writing of individual bits in the stencil planes.
| Name | Type |
|---|---|
mask |
Int |
Controls enabling and disabling of front and/or back writing of individual bits in the stencil planes.
| Name | Type |
|---|---|
face |
Int |
mask |
Int |
Sets both the front and back-facing stencil test actions.
| Name | Type |
|---|---|
fail |
Int |
zfail |
Int |
zpass |
Int |
Sets the front and/or back-facing stencil test actions.
| Name | Type |
|---|---|
face |
Int |
fail |
Int |
zfail |
Int |
zpass |
Int |
| Name | Type |
|---|---|
target |
Int |
pname |
Int |
param |
Float |
| Name | Type |
|---|---|
target |
Int |
pname |
Int |
param |
Int |
uniform1f(location: UniformLocation, x: Float): Void| Name | Type |
|---|---|
location |
UniformLocation |
x |
Float |
uniform2f(location: UniformLocation, x: Float, y: Float): Void| Name | Type |
|---|---|
location |
UniformLocation |
x |
Float |
y |
Float |
uniform3f(location: UniformLocation, x: Float, y: Float, z: Float): Void| Name | Type |
|---|---|
location |
UniformLocation |
x |
Float |
y |
Float |
z |
Float |
| Name | Type |
|---|---|
location |
UniformLocation |
x |
Float |
y |
Float |
z |
Float |
w |
Float |
uniform1i(location: UniformLocation, x: Int): Void| Name | Type |
|---|---|
location |
UniformLocation |
x |
Int |
uniform2i(location: UniformLocation, x: Int, y: Int): Void| Name | Type |
|---|---|
location |
UniformLocation |
x |
Int |
y |
Int |
uniform3i(location: UniformLocation, x: Int, y: Int, z: Int): Void| Name | Type |
|---|---|
location |
UniformLocation |
x |
Int |
y |
Int |
z |
Int |
| Name | Type |
|---|---|
location |
UniformLocation |
x |
Int |
y |
Int |
z |
Int |
w |
Int |
Uses the specified WebGLProgram as part the current rendering state.
| Name | Type |
|---|---|
program |
Program |
Validates a WebGLProgram.
| Name | Type |
|---|---|
program |
Program |
| Name | Type |
|---|---|
indx |
Int |
x |
Float |
vertexAttrib1fv(indx: Int, values: js.lib.Float32Array): Void| Name | Type |
|---|---|
indx |
Int |
values |
js.lib.Float32Array |
| Name | Type |
|---|---|
indx |
Int |
x |
Float |
y |
Float |
vertexAttrib2fv(indx: Int, values: js.lib.Float32Array): Void| Name | Type |
|---|---|
indx |
Int |
values |
js.lib.Float32Array |
| Name | Type |
|---|---|
indx |
Int |
x |
Float |
y |
Float |
z |
Float |
vertexAttrib3fv(indx: Int, values: js.lib.Float32Array): Void| Name | Type |
|---|---|
indx |
Int |
values |
js.lib.Float32Array |
| Name | Type |
|---|---|
indx |
Int |
x |
Float |
y |
Float |
z |
Float |
w |
Float |
vertexAttrib4fv(indx: Int, values: js.lib.Float32Array): Void| Name | Type |
|---|---|
indx |
Int |
values |
js.lib.Float32Array |
vertexAttribPointer(indx: Int, size: Int, type: Int, normalized: Bool, stride: Int, offset: Int): VoidSpecifies the data formats and locations of vertex attributes in a vertex attributes array.
| Name | Type |
|---|---|
indx |
Int |
size |
Int |
type |
Int |
normalized |
Bool |
stride |
Int |
offset |
Int |
Sets the viewport.
| Name | Type |
|---|---|
x |
Int |
y |
Int |
width |
Int |
height |
Int |