trait WebGL2RenderingContext extends Object with WebGLRenderingContext
The WebGL2RenderingContext interface provides the OpenGL ES 3.0 rendering context for the drawing surface of an HTML <canvas> element.
WebGL 2 is an extension to WebGL 1. The WebGL2RenderingContext interface implements all members of the WebGLRenderingContext interface. Some methods of the WebGL 1 context can accept additional values when used in a WebGL 2 context. You will find this info noted on the WebGL 1 reference pages.
- Annotations
- @RawJSType() @native()
- See also
https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext
- Alphabetic
- By Inheritance
- WebGL2RenderingContext
- WebGLRenderingContext
- RenderingContext
- Object
- Any
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
ARRAY_BUFFER: GLenum
- Definition Classes
- WebGLRenderingContext
- def COLOR_BUFFER_BIT: GLbitfield
-
def
COMPILE_STATUS: GLenum
- Definition Classes
- WebGLRenderingContext
-
def
COPY_READ_BUFFER: GLenum
- Definition Classes
- WebGLRenderingContext
-
def
COPY_WRITE_BUFFER: GLenum
- Definition Classes
- WebGLRenderingContext
-
def
DELETE_STATUS: GLenum
- Definition Classes
- WebGLRenderingContext
- def DEPTH_BUFFER_BIT: GLbitfield
-
def
ELEMENT_ARRAY_BUFFER: GLenum
- Definition Classes
- WebGLRenderingContext
-
def
FRAGMENT_SHADER: GLenum
- Definition Classes
- WebGLRenderingContext
-
def
HIGH_FLOAT: GLprecision
- Definition Classes
- WebGLRenderingContext
-
def
HIGH_INT: GLprecision
- Definition Classes
- WebGLRenderingContext
- def LINEAR: GLenum
-
def
LOW_FLOAT: GLprecision
- Definition Classes
- WebGLRenderingContext
-
def
LOW_INT: GLprecision
- Definition Classes
- WebGLRenderingContext
-
def
MEDIUM_FLOAT: GLprecision
- Definition Classes
- WebGLRenderingContext
-
def
MEDIUM_INT: GLprecision
- Definition Classes
- WebGLRenderingContext
- def NEAREST: GLenum
-
def
PIXEL_PACK_BUFFER: GLenum
- Definition Classes
- WebGLRenderingContext
-
def
PIXEL_UNPACK_BUFFER: GLenum
- Definition Classes
- WebGLRenderingContext
-
def
SHADER_TYPE: GLenum
- Definition Classes
- WebGLRenderingContext
- def STENCIL_BUFFER_BIT: GLbitfield
-
def
TEXTURE_2D: GLenum
- Definition Classes
- WebGLRenderingContext
-
def
TEXTURE_2D_ARRAY: GLenum
- Definition Classes
- WebGLRenderingContext
-
def
TEXTURE_3D: GLenum
- Definition Classes
- WebGLRenderingContext
-
def
TEXTURE_CUBE_MAP: GLenum
- Definition Classes
- WebGLRenderingContext
-
def
TRANSFORM_FEEDBACK_BUFFER: GLenum
- Definition Classes
- WebGLRenderingContext
-
def
TRANSFORM_FEEDBACK_BUFFER_BINDING: GLenum
- Definition Classes
- WebGLRenderingContext
-
def
TRANSFORM_FEEDBACK_BUFFER_SIZE: GLenum
- Definition Classes
- WebGLRenderingContext
-
def
TRANSFORM_FEEDBACK_BUFFER_START: GLenum
- Definition Classes
- WebGLRenderingContext
-
def
UNIFORM_BUFFER: GLenum
- Definition Classes
- WebGLRenderingContext
-
def
UNIFORM_BUFFER_BINDING: GLenum
- Definition Classes
- WebGLRenderingContext
-
def
UNIFORM_BUFFER_SIZE: GLenum
- Definition Classes
- WebGLRenderingContext
-
def
UNIFORM_BUFFER_START: GLenum
- Definition Classes
- WebGLRenderingContext
-
def
VERTEX_SHADER: GLenum
- Definition Classes
- WebGLRenderingContext
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
bindBuffer(target: GLenum, buffer: WebGLBuffer): Unit
Binds a given WebGLBuffer to a target.
Binds a given WebGLBuffer to a target.
- target
A GLenum specifying the binding point (target). Possible values:
- gl.ARRAY_BUFFER: Buffer containing vertex attributes, such as vertex coordinates, texture coordinate data, or vertex color data.
- gl.ELEMENT_ARRAY_BUFFER: Buffer used for element indices.
- When using a WebGL 2 context, the following values are available additionally:
- gl.COPY_READ_BUFFER: Buffer for copying from one buffer object to another.
- gl.COPY_WRITE_BUFFER: Buffer for copying from one buffer object to another.
- gl.TRANSFORM_FEEDBACK_BUFFER: Buffer for transform feedback operations.
- gl.UNIFORM_BUFFER: Buffer used for storing uniform blocks.
- gl.PIXEL_PACK_BUFFER: Buffer used for pixel transfer operations.
- gl.PIXEL_UNPACK_BUFFER: Buffer used for pixel transfer operations.
- buffer
A WebGLBuffer to bind.
- Definition Classes
- WebGLRenderingContext
-
def
bindTexture(target: GLenum, texture: WebGLTexture): Unit
Binds a given WebGLTexture to a target (binding point).
Binds a given WebGLTexture to a target (binding point).
- target
A GLenum specifying the binding point (target). Possible values:
- gl.TEXTURE_2D: A two-dimensional texture.
- gl.TEXTURE_CUBE_MAP: A cube-mapped texture.
- When using a WebGL 2 context, the following values are available additionally:
- gl.TEXTURE_3D: A three-dimensional texture.
- gl.TEXTURE_2D_ARRAY: A two-dimensional array texture.
- texture
A WebGLTexture object to bind.
- Definition Classes
- WebGLRenderingContext
-
def
blitFramebuffer(srcX0: GLint, srcY0: GLint, srcX1: GLint, srcY1: GLint, dstX0: GLint, dstY0: GLint, dstX1: GLint, dstY1: GLint, mask: GLbitfield, filter: GLenum): Unit
Transfers a block of pixels from the read framebuffer to the draw framebuffer.
Transfers a block of pixels from the read framebuffer to the draw framebuffer.
- srcX0
A GLint specifying the bounds of the source rectangle.
- srcY0
A GLint specifying the bounds of the source rectangle.
- srcX1
A GLint specifying the bounds of the source rectangle.
- srcY1
A GLint specifying the bounds of the source rectangle.
- dstX0
A GLint specifying the bounds of the destination rectangle.
- dstY0
A GLint specifying the bounds of the destination rectangle.
- dstX1
A GLint specifying the bounds of the destination rectangle.
- dstY1
A GLint specifying the bounds of the destination rectangle.
- mask
A GLbitfield specifying a bitwise OR mask indicating which buffers are to be copied.
- filter
A GLenum specifying the interpolation to be applied if the image is stretched.
-
def
canvas: HTMLCanvasElement
A read-only back-reference to the HTMLCanvasElement.
A read-only back-reference to the HTMLCanvasElement. Might be null if it is not associated with a <canvas> element.
- Definition Classes
- WebGLRenderingContext
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
compileShader(shader: WebGLShader): Unit
Compiles a GLSL shader into binary data so that it can be used by a WebGLProgram.
Compiles a GLSL shader into binary data so that it can be used by a WebGLProgram.
- shader
A fragment or vertex WebGLShader.
- Definition Classes
- WebGLRenderingContext
-
def
copyBufferSubData(readTarget: GLenum, writeTarget: GLenum, readOffset: GLintptr, writeOffset: GLintptr, size: GLsizei): Unit
Copies part of the data of a buffer to another buffer.
Copies part of the data of a buffer to another buffer.
- readTarget
A GLenum specifying the binding point (target) from whose data store should be read.
- writeTarget
A GLenum specifying the binding point (target) from whose data store should be written.
- readOffset
A GLintptr specifying the byte offset from which to start reading from the buffer.
- writeOffset
A GLintptr specifying the byte offset from which to start writing to the buffer.
- size
A GLsizei in bytes specifying the size of the data to be copied from readTarget to writeTarget.
-
def
createBuffer(): WebGLBuffer
Returns a WebGLBuffer storing data such as vertices or colors.
Returns a WebGLBuffer storing data such as vertices or colors.
- returns
a WebGLBuffer storing data such as vertices or colors.
- Definition Classes
- WebGLRenderingContext
-
def
createProgram(): WebGLProgram
Returns a WebGLProgram object that is a combination of two compiled WebGLShaders consisting of a vertex shader and a fragment shader (both written in GLSL).
Returns a WebGLProgram object that is a combination of two compiled WebGLShaders consisting of a vertex shader and a fragment shader (both written in GLSL). These are then linked into a usable program.
- returns
A WebGLProgram object that is a combination of two compiled WebGLShaders consisting of a vertex shader and a fragment shader (both written in GLSL).
- Definition Classes
- WebGLRenderingContext
-
def
createShader(type: GLenum): WebGLShader
Creates a WebGLShader that can then be configured further using WebGLRenderingContext.shaderSource() and WebGLRenderingContext.compileShader().
Creates a WebGLShader that can then be configured further using WebGLRenderingContext.shaderSource() and WebGLRenderingContext.compileShader().
- returns
a new WebGLShader
- Definition Classes
- WebGLRenderingContext
-
def
createTexture(): WebGLTexture
Creates and initializes a WebGLTexture object.
Creates and initializes a WebGLTexture object.
- returns
a WebGLTexture object.
- Definition Classes
- WebGLRenderingContext
-
def
deleteBuffer(buffer: WebGLBuffer): Unit
Deletes a given WebGLBuffer.
Deletes a given WebGLBuffer. This method has no effect if the buffer has already been deleted.
- buffer
the given WebGLBuffer
- Definition Classes
- WebGLRenderingContext
-
def
deleteTexture(texture: WebGLTexture): Unit
Deletes a given WebGLTexture object.
Deletes a given WebGLTexture object. This method has no effect if the texture has already been deleted.
- texture
A WebGLTexture object to delete.
- Definition Classes
- WebGLRenderingContext
-
def
drawingBufferHeight: Int
The read-only height of the current drawing buffer.
The read-only height of the current drawing buffer. Should match the height of the canvas element associated with this context.
- Definition Classes
- WebGLRenderingContext
-
def
drawingBufferWidth: Int
The read-only width of the current drawing buffer.
The read-only width of the current drawing buffer. Should match the width of the canvas element associated with this context.
- Definition Classes
- WebGLRenderingContext
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
getBufferSubData(target: GLenum, srcByteOffset: GLintptr, dstData: ArrayBuffer, dstOffset: GLuint = js.native, length: Int = js.native): Unit
Reads data from a buffer binding point and writes them to an ArrayBuffer or SharedArrayBuffer.
Reads data from a buffer binding point and writes them to an ArrayBuffer or SharedArrayBuffer.
- target
A GLenum specifying the binding point (target).
- srcByteOffset
A GLintptr specifying the byte offset from which to start reading from the buffer.
- dstData
An ArrayBuffer or SharedArrayBuffer to which to write the buffer data.
- dstOffset
A GLuint specifying the element index offset where to start reading the buffer.
- length
A GLuint defaulting to 0.
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
getIndexedParameter(target: GLenum, index: Int): Any
Returns the indexed value for the given target.
Returns the indexed value for the given target.
- target
A Glenum specifying the target for which to return information
- index
A GLuint specifying the index of the target that is queried.
- returns
Depends on the requested information (as specified with target).
-
def
getProgramParameter(program: WebGLProgram, pname: GLenum): Any
Returns information about the given program.
Returns information about the given program.
- program
A WebGLProgram to get parameter information from.
- pname
A GLenum specifying the information to query. Possible values:
- returns
the requested program information (as specified with pname).
- Definition Classes
- WebGLRenderingContext
gl.getProgramParameter(program, gl.DELETE_STATUS)
Example: -
def
getShaderParameter(shader: WebGLShader, pname: GLenum): Any
Returns information about the given shader.
Returns information about the given shader.
- shader
A WebGLShader to get parameter information from.
- pname
A GLenum specifying the information to query. Possible values:
- gl.DELETE_STATUS: Returns a GLboolean indicating whether or not the shader is flagged for deletion.
- gl.COMPILE_STATUS: Returns a GLboolean indicating whether or not the las shader compilation was successful.
- gl.SHADER_TYPE: Returns a GLenum indicating the whether the shader is a vertex shader (gl.VERTEX_SHADER) or fragment shader (gl.FRAGMENT_SHADER) object.
- returns
the requested shader information (as specified with pname).
- Definition Classes
- WebGLRenderingContext
-
def
getShaderPrecisionFormat(shaderType: GLenum, precisionType: GLprecision): WebGLShaderPrecisionFormat
Returns a new WebGLShaderPrecisionFormat object describing the range and precision for the specified shader numeric format.
Returns a new WebGLShaderPrecisionFormat object describing the range and precision for the specified shader numeric format.
- shaderType
Either a FRAGMENT_SHADER or a VERTEX_SHADER.
- precisionType
A precision type value. Either LOW_FLOAT, MEDIUM_FLOAT, HIGH_FLOAT, LOW_INT, MEDIUM_INT, or HIGH_INT.
- returns
A WebGLShaderPrecisionFormat object or null, if an error occurs.
- Definition Classes
- WebGLRenderingContext
gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.MEDIUM_FLOAT)
Example: -
def
hasOwnProperty(v: String): Boolean
- Definition Classes
- Object
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
def
isBuffer(buffer: Any): Boolean
Returns true if the passed WebGLBuffer is valid and false otherwise.
Returns true if the passed WebGLBuffer is valid and false otherwise.
- buffer
the given object to test
- returns
true if the passed WebGLBuffer is valid and false otherwise.
- Definition Classes
- WebGLRenderingContext
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
isProgram(program: Any): Boolean
Returns true if the passed WebGLProgram is valid, false otherwise.
Returns true if the passed WebGLProgram is valid, false otherwise.
- program
A WebGLProgram to check.
- returns
true if the passed WebGLProgram is valid, false otherwise.
- Definition Classes
- WebGLRenderingContext
-
def
isPrototypeOf(v: Object): Boolean
- Definition Classes
- Object
-
def
isTexture(texture: Any): Boolean
Returns true if the passed WebGLTexture is valid and false otherwise.
Returns true if the passed WebGLTexture is valid and false otherwise.
- texture
the passed WebGLTexture
- returns
true if the passed WebGLTexture is valid and false otherwise.
- Definition Classes
- WebGLRenderingContext
-
def
linkProgram(program: WebGLProgram): Unit
Links a given WebGLProgram to the attached vertex and fragment shaders.
Links a given WebGLProgram to the attached vertex and fragment shaders.
- program
A WebGLProgram to link.
- Definition Classes
- WebGLRenderingContext
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
propertyIsEnumerable(v: String): Boolean
- Definition Classes
- Object
-
def
shaderSource(shader: WebGLShader, source: DOMString): Unit
Sets the source code of a WebGLShader.
Sets the source code of a WebGLShader.
- shader
A WebGLShader object in which to set the source code.
- source
A DOMString containing the GLSL source code to set.
- Definition Classes
- WebGLRenderingContext
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toLocaleString(): String
- Definition Classes
- Object
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
useProgram(program: WebGLProgram): Unit
Sets the specified WebGLProgram as part the current rendering state.
Sets the specified WebGLProgram as part the current rendering state.
- program
A WebGLProgram to use.
- Definition Classes
- WebGLRenderingContext
-
def
validateProgram(program: WebGLProgram): Unit
Validates a WebGLProgram.
Validates a WebGLProgram. It checks if it is successfully linked and if it can be used in the current WebGL state.
- program
A WebGLProgram to validate.
- Definition Classes
- WebGLRenderingContext
-
def
valueOf(): Any
- Definition Classes
- Object
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )