Trait

io.scalajs.dom.html.canvas.webgl

WebGL2RenderingContext

Related Doc: package webgl

Permalink

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

Linear Supertypes
WebGLRenderingContext, RenderingContext, Object, Any, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. WebGL2RenderingContext
  2. WebGLRenderingContext
  3. RenderingContext
  4. Object
  5. Any
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def ARRAY_BUFFER: GLenum

    Permalink
    Definition Classes
    WebGLRenderingContext
  5. def COLOR_BUFFER_BIT: GLbitfield

    Permalink
  6. def COMPILE_STATUS: GLenum

    Permalink
    Definition Classes
    WebGLRenderingContext
  7. def COPY_READ_BUFFER: GLenum

    Permalink
    Definition Classes
    WebGLRenderingContext
  8. def COPY_WRITE_BUFFER: GLenum

    Permalink
    Definition Classes
    WebGLRenderingContext
  9. def DELETE_STATUS: GLenum

    Permalink
    Definition Classes
    WebGLRenderingContext
  10. def DEPTH_BUFFER_BIT: GLbitfield

    Permalink
  11. def ELEMENT_ARRAY_BUFFER: GLenum

    Permalink
    Definition Classes
    WebGLRenderingContext
  12. def FRAGMENT_SHADER: GLenum

    Permalink
    Definition Classes
    WebGLRenderingContext
  13. def HIGH_FLOAT: GLprecision

    Permalink
    Definition Classes
    WebGLRenderingContext
  14. def HIGH_INT: GLprecision

    Permalink
    Definition Classes
    WebGLRenderingContext
  15. def LINEAR: GLenum

    Permalink
  16. def LOW_FLOAT: GLprecision

    Permalink
    Definition Classes
    WebGLRenderingContext
  17. def LOW_INT: GLprecision

    Permalink
    Definition Classes
    WebGLRenderingContext
  18. def MEDIUM_FLOAT: GLprecision

    Permalink
    Definition Classes
    WebGLRenderingContext
  19. def MEDIUM_INT: GLprecision

    Permalink
    Definition Classes
    WebGLRenderingContext
  20. def NEAREST: GLenum

    Permalink
  21. def PIXEL_PACK_BUFFER: GLenum

    Permalink
    Definition Classes
    WebGLRenderingContext
  22. def PIXEL_UNPACK_BUFFER: GLenum

    Permalink
    Definition Classes
    WebGLRenderingContext
  23. def SHADER_TYPE: GLenum

    Permalink
    Definition Classes
    WebGLRenderingContext
  24. def STENCIL_BUFFER_BIT: GLbitfield

    Permalink
  25. def TEXTURE_2D: GLenum

    Permalink
    Definition Classes
    WebGLRenderingContext
  26. def TEXTURE_2D_ARRAY: GLenum

    Permalink
    Definition Classes
    WebGLRenderingContext
  27. def TEXTURE_3D: GLenum

    Permalink
    Definition Classes
    WebGLRenderingContext
  28. def TEXTURE_CUBE_MAP: GLenum

    Permalink
    Definition Classes
    WebGLRenderingContext
  29. def TRANSFORM_FEEDBACK_BUFFER: GLenum

    Permalink
    Definition Classes
    WebGLRenderingContext
  30. def TRANSFORM_FEEDBACK_BUFFER_BINDING: GLenum

    Permalink
    Definition Classes
    WebGLRenderingContext
  31. def TRANSFORM_FEEDBACK_BUFFER_SIZE: GLenum

    Permalink
    Definition Classes
    WebGLRenderingContext
  32. def TRANSFORM_FEEDBACK_BUFFER_START: GLenum

    Permalink
    Definition Classes
    WebGLRenderingContext
  33. def UNIFORM_BUFFER: GLenum

    Permalink
    Definition Classes
    WebGLRenderingContext
  34. def UNIFORM_BUFFER_BINDING: GLenum

    Permalink
    Definition Classes
    WebGLRenderingContext
  35. def UNIFORM_BUFFER_SIZE: GLenum

    Permalink
    Definition Classes
    WebGLRenderingContext
  36. def UNIFORM_BUFFER_START: GLenum

    Permalink
    Definition Classes
    WebGLRenderingContext
  37. def VERTEX_SHADER: GLenum

    Permalink
    Definition Classes
    WebGLRenderingContext
  38. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  39. def bindBuffer(target: GLenum, buffer: WebGLBuffer): Unit

    Permalink

    Binds a given WebGLBuffer to a target.

    Binds a given WebGLBuffer to a target.

    target

    A GLenum specifying the binding point (target). Possible values:

    buffer

    A WebGLBuffer to bind.

    Definition Classes
    WebGLRenderingContext
  40. def bindTexture(target: GLenum, texture: WebGLTexture): Unit

    Permalink

    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:

    texture

    A WebGLTexture object to bind.

    Definition Classes
    WebGLRenderingContext
  41. def blitFramebuffer(srcX0: GLint, srcY0: GLint, srcX1: GLint, srcY1: GLint, dstX0: GLint, dstY0: GLint, dstX1: GLint, dstY1: GLint, mask: GLbitfield, filter: GLenum): Unit

    Permalink

    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.

  42. def canvas: HTMLCanvasElement

    Permalink

    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
  43. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  44. def compileShader(shader: WebGLShader): Unit

    Permalink

    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
  45. def copyBufferSubData(readTarget: GLenum, writeTarget: GLenum, readOffset: GLintptr, writeOffset: GLintptr, size: GLsizei): Unit

    Permalink

    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.

  46. def createBuffer(): WebGLBuffer

    Permalink

    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
  47. def createProgram(): WebGLProgram

    Permalink

    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
  48. def createShader(type: GLenum): WebGLShader

    Permalink

    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
  49. def createTexture(): WebGLTexture

    Permalink

    Creates and initializes a WebGLTexture object.

    Creates and initializes a WebGLTexture object.

    returns

    a WebGLTexture object.

    Definition Classes
    WebGLRenderingContext
  50. def deleteBuffer(buffer: WebGLBuffer): Unit

    Permalink

    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
  51. def deleteTexture(texture: WebGLTexture): Unit

    Permalink

    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
  52. def drawingBufferHeight: Int

    Permalink

    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
  53. def drawingBufferWidth: Int

    Permalink

    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
  54. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  55. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  56. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  57. def getBufferSubData(target: GLenum, srcByteOffset: GLintptr, dstData: ArrayBuffer, dstOffset: GLuint = js.native, length: Int = js.native): Unit

    Permalink

    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.

  58. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  59. def getIndexedParameter(target: GLenum, index: Int): Any

    Permalink

    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).

  60. def getProgramParameter(program: WebGLProgram, pname: GLenum): Any

    Permalink

    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
    Example:
    1. gl.getProgramParameter(program, gl.DELETE_STATUS)
  61. def getShaderParameter(shader: WebGLShader, pname: GLenum): Any

    Permalink

    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
  62. def getShaderPrecisionFormat(shaderType: GLenum, precisionType: GLprecision): WebGLShaderPrecisionFormat

    Permalink

    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
    Example:
    1. gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.MEDIUM_FLOAT)
  63. def hasOwnProperty(v: String): Boolean

    Permalink
    Definition Classes
    Object
  64. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  65. def isBuffer(buffer: Any): Boolean

    Permalink

    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
  66. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  67. def isProgram(program: Any): Boolean

    Permalink

    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
  68. def isPrototypeOf(v: Object): Boolean

    Permalink
    Definition Classes
    Object
  69. def isTexture(texture: Any): Boolean

    Permalink

    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
  70. def linkProgram(program: WebGLProgram): Unit

    Permalink

    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
  71. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  72. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  73. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  74. def propertyIsEnumerable(v: String): Boolean

    Permalink
    Definition Classes
    Object
  75. def shaderSource(shader: WebGLShader, source: DOMString): Unit

    Permalink

    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
  76. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  77. def toLocaleString(): String

    Permalink
    Definition Classes
    Object
  78. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  79. def useProgram(program: WebGLProgram): Unit

    Permalink

    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
  80. def validateProgram(program: WebGLProgram): Unit

    Permalink

    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
  81. def valueOf(): Any

    Permalink
    Definition Classes
    Object
  82. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  83. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  84. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from WebGLRenderingContext

Inherited from RenderingContext

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped