trait WebGLRenderingContext extends Object with RenderingContext
The WebGLRenderingContext interface provides the OpenGL ES 2.0 rendering context for the drawing surface of an HTML <canvas> element.
- Annotations
- @RawJSType() @native()
- See also
https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants
https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext
- Alphabetic
- By Inheritance
- 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
- def COMPILE_STATUS: GLenum
- def COPY_READ_BUFFER: GLenum
- def COPY_WRITE_BUFFER: GLenum
- def DELETE_STATUS: GLenum
- def ELEMENT_ARRAY_BUFFER: GLenum
- def FRAGMENT_SHADER: GLenum
- def HIGH_FLOAT: GLprecision
- def HIGH_INT: GLprecision
- def LOW_FLOAT: GLprecision
- def LOW_INT: GLprecision
- def MEDIUM_FLOAT: GLprecision
- def MEDIUM_INT: GLprecision
- def PIXEL_PACK_BUFFER: GLenum
- def PIXEL_UNPACK_BUFFER: GLenum
- def SHADER_TYPE: GLenum
- def TEXTURE_2D: GLenum
- def TEXTURE_2D_ARRAY: GLenum
- def TEXTURE_3D: GLenum
- def TEXTURE_CUBE_MAP: GLenum
- def TRANSFORM_FEEDBACK_BUFFER: GLenum
- def TRANSFORM_FEEDBACK_BUFFER_BINDING: GLenum
- def TRANSFORM_FEEDBACK_BUFFER_SIZE: GLenum
- def TRANSFORM_FEEDBACK_BUFFER_START: GLenum
- def UNIFORM_BUFFER: GLenum
- def UNIFORM_BUFFER_BINDING: GLenum
- def UNIFORM_BUFFER_SIZE: GLenum
- def UNIFORM_BUFFER_START: GLenum
- def VERTEX_SHADER: GLenum
-
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.
-
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.
-
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.
-
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.
-
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.
-
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).
-
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
-
def
createTexture(): WebGLTexture
Creates and initializes a WebGLTexture object.
Creates and initializes a WebGLTexture object.
- returns
a WebGLTexture object.
-
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
-
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.
-
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.
-
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.
-
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] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
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).
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).
-
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.
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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( ... )