Packages

t

io.scalajs.dom.html.canvas.webgl

WebGLRenderingContext

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

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

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def ARRAY_BUFFER: GLenum
  5. def COMPILE_STATUS: GLenum
  6. def COPY_READ_BUFFER: GLenum
  7. def COPY_WRITE_BUFFER: GLenum
  8. def DELETE_STATUS: GLenum
  9. def ELEMENT_ARRAY_BUFFER: GLenum
  10. def FRAGMENT_SHADER: GLenum
  11. def HIGH_FLOAT: GLprecision
  12. def HIGH_INT: GLprecision
  13. def LOW_FLOAT: GLprecision
  14. def LOW_INT: GLprecision
  15. def MEDIUM_FLOAT: GLprecision
  16. def MEDIUM_INT: GLprecision
  17. def PIXEL_PACK_BUFFER: GLenum
  18. def PIXEL_UNPACK_BUFFER: GLenum
  19. def SHADER_TYPE: GLenum
  20. def TEXTURE_2D: GLenum
  21. def TEXTURE_2D_ARRAY: GLenum
  22. def TEXTURE_3D: GLenum
  23. def TEXTURE_CUBE_MAP: GLenum
  24. def TRANSFORM_FEEDBACK_BUFFER: GLenum
  25. def TRANSFORM_FEEDBACK_BUFFER_BINDING: GLenum
  26. def TRANSFORM_FEEDBACK_BUFFER_SIZE: GLenum
  27. def TRANSFORM_FEEDBACK_BUFFER_START: GLenum
  28. def UNIFORM_BUFFER: GLenum
  29. def UNIFORM_BUFFER_BINDING: GLenum
  30. def UNIFORM_BUFFER_SIZE: GLenum
  31. def UNIFORM_BUFFER_START: GLenum
  32. def VERTEX_SHADER: GLenum
  33. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  34. 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:

    buffer

    A WebGLBuffer to bind.

  35. 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:

    texture

    A WebGLTexture object to bind.

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

  37. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  38. 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.

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

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

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

  42. def createTexture(): WebGLTexture

    Creates and initializes a WebGLTexture object.

    Creates and initializes a WebGLTexture object.

    returns

    a WebGLTexture object.

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

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

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

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

  47. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  48. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  49. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  50. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
  51. 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).

    Example:
    1. gl.getProgramParameter(program, gl.DELETE_STATUS)
  52. 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).

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

    Example:
    1. gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.MEDIUM_FLOAT)
  54. def hasOwnProperty(v: String): Boolean
    Definition Classes
    Object
  55. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  56. 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.

  57. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  58. 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.

  59. def isPrototypeOf(v: Object): Boolean
    Definition Classes
    Object
  60. 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.

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

  62. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  63. final def notify(): Unit
    Definition Classes
    AnyRef
  64. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  65. def propertyIsEnumerable(v: String): Boolean
    Definition Classes
    Object
  66. 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.

  67. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  68. def toLocaleString(): String
    Definition Classes
    Object
  69. def toString(): String
    Definition Classes
    AnyRef → Any
  70. 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.

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

  72. def valueOf(): Any
    Definition Classes
    Object
  73. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  74. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  75. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from RenderingContext

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped