Options
All
  • Public
  • Public/Protected
  • All
Menu

Class GL2Facade

A WebGL 2 facade, simplifying the access to gl functions that are either not available, exposed via extension or supported directly, e.g., in webgl2. All gl features/interfaces handled by this facade are mandatory.

Hierarchy

  • GL2Facade

Index

Constructors

constructor

Properties

Protected _colorAttachmentMax

_colorAttachmentMax: GLenum

Stores the highest supported color attachment identifier.

Protected _colorAttachmentMin

_colorAttachmentMin: GLenum

Stores the lowest color attachment identifier.

Protected _colorAttachments

_colorAttachments: Array<GLenum>

Stores all context/backend sepcific color attachment identifier for COLOR_ATTACHMENT# getter.

Protected _halfFloat

_halfFloat: GLenum

Stores the HALF_FLOAT enum if supported. @see HALF_FLOAT

Protected _maxUniformVec3Components

_maxUniformVec3Components: GLint | undefined

bindVertexArray

bindVertexArray: function

Type declaration

    • (arrayObject: any): void
    • Parameters

      • arrayObject: any

      Returns void

bufferSubData

bufferSubData: function

Type declaration

    • (target: GLenum, dstByteOffset: GLintptr, srcData: ArrayBufferView | ArrayBuffer, srcOffset: GLuint, length: GLuint): void
    • Parameters

      • target: GLenum
      • dstByteOffset: GLintptr
      • srcData: ArrayBufferView | ArrayBuffer
      • srcOffset: GLuint
      • length: GLuint

      Returns void

createVertexArray

createVertexArray: function

Type declaration

    • (): any
    • Returns any

deleteVertexArray

deleteVertexArray: function

Type declaration

    • (arrayObject: any): void
    • Parameters

      • arrayObject: any

      Returns void

drawArraysInstanced

drawArraysInstanced: function

Type declaration

    • (mode: GLenum, first: GLint, count: GLsizei, instanceCount: GLsizei): void
    • Parameters

      • mode: GLenum
      • first: GLint
      • count: GLsizei
      • instanceCount: GLsizei

      Returns void

drawBuffers

drawBuffers: function | undefined = undefined

drawElementsInstanced

drawElementsInstanced: function

Type declaration

    • (mode: GLenum, count: GLint, type: GLsizei, offset: GLintptr, primcount: GLsizei): void
    • Parameters

      • mode: GLenum
      • count: GLint
      • type: GLsizei
      • offset: GLintptr
      • primcount: GLsizei

      Returns void

isVertexArray

isVertexArray: function

Type declaration

    • (arrayObject: any): GLboolean
    • Parameters

      • arrayObject: any

      Returns GLboolean

texImage2D

texImage2D: function

Type declaration

    • (target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, border: GLint, format: GLenum, type: GLenum, source?: TexImage2DData, offset?: GLintptr): void
    • Parameters

      • target: GLenum
      • level: GLint
      • internalformat: GLenum
      • width: GLsizei
      • height: GLsizei
      • border: GLint
      • format: GLenum
      • type: GLenum
      • Optional source: TexImage2DData
      • Optional offset: GLintptr

      Returns void

texImage3D

texImage3D: function

Type declaration

    • (target: GLenum, level: GLint, internalformat: GLenum, width: GLsizei, height: GLsizei, depth: GLsizei, border: GLint, format: GLenum, type: GLenum, source?: TexImage2DData, offset?: GLintptr): void
    • Parameters

      • target: GLenum
      • level: GLint
      • internalformat: GLenum
      • width: GLsizei
      • height: GLsizei
      • depth: GLsizei
      • border: GLint
      • format: GLenum
      • type: GLenum
      • Optional source: TexImage2DData
      • Optional offset: GLintptr

      Returns void

vertexAttribDivisor

vertexAttribDivisor: function

Type declaration

    • (index: GLuint, divisor: GLuint): void
    • Parameters

      • index: GLuint
      • divisor: GLuint

      Returns void

Accessors

COLOR_ATTACHMENT0

  • get COLOR_ATTACHMENT0(): GLenum

COLOR_ATTACHMENT1

  • get COLOR_ATTACHMENT1(): GLenum

COLOR_ATTACHMENT10

  • get COLOR_ATTACHMENT10(): GLenum

COLOR_ATTACHMENT11

  • get COLOR_ATTACHMENT11(): GLenum

COLOR_ATTACHMENT12

  • get COLOR_ATTACHMENT12(): GLenum

COLOR_ATTACHMENT13

  • get COLOR_ATTACHMENT13(): GLenum

COLOR_ATTACHMENT14

  • get COLOR_ATTACHMENT14(): GLenum

COLOR_ATTACHMENT15

  • get COLOR_ATTACHMENT15(): GLenum

COLOR_ATTACHMENT2

  • get COLOR_ATTACHMENT2(): GLenum

COLOR_ATTACHMENT3

  • get COLOR_ATTACHMENT3(): GLenum

COLOR_ATTACHMENT4

  • get COLOR_ATTACHMENT4(): GLenum

COLOR_ATTACHMENT5

  • get COLOR_ATTACHMENT5(): GLenum

COLOR_ATTACHMENT6

  • get COLOR_ATTACHMENT6(): GLenum

COLOR_ATTACHMENT7

  • get COLOR_ATTACHMENT7(): GLenum

COLOR_ATTACHMENT8

  • get COLOR_ATTACHMENT8(): GLenum

COLOR_ATTACHMENT9

  • get COLOR_ATTACHMENT9(): GLenum

COLOR_ATTACHMENT_MAX

  • get COLOR_ATTACHMENT_MAX(): GLenum
  • The lowest color attachment identifier format enum. Is at least COLOR_ATTACHMENT_MIN.

    Returns GLenum

COLOR_ATTACHMENT_MIN

  • get COLOR_ATTACHMENT_MIN(): GLenum
  • The lowest color attachment identifier format enum.

    Returns GLenum

HALF_FLOAT

  • get HALF_FLOAT(): GLenum
  • The HALF_FLOAT format enum. Is undefined if not supported.

    Returns GLenum

maxUniformVec3Components

  • get maxUniformVec3Components(): GLint | undefined
  • The maximum number of floats, integers, or booleans that can be in storage for a vertex shader.

    Returns GLint | undefined

Methods

Protected queryBufferSubDataInterface

  • queryBufferSubDataInterface(context: Context): void

Protected queryColorAttachments

  • queryColorAttachments(context: Context): void
  • Queries the valid range of color attachments and provides an interface for convenience.

    Parameters

    Returns void

Protected queryDrawBuffersSupport

  • queryDrawBuffersSupport(context: Context): void
  • Evaluate wether or not WEBGL_draw_buffers is supported (either by extension or in WebGL2 by default) and, if supported, binds the associated functions.

    Parameters

    • context: Context

      WebGL context to query extension support in.

    Returns void

    • True if WEBGL_draw_buffers is supported and associated functions are bound.

Protected queryHalfFloatSupport

  • queryHalfFloatSupport(context: Context): void
  • For WebGL1 the HALF_FLOAT enum needs to be saved via the extension object.

    Parameters

    Returns void

Protected queryInstancedArraySupport

  • queryInstancedArraySupport(context: Context): void
  • Evaluate wether or not ANGLE_instanced_arrays is supported (either by extension or in WebGL2 by default) and, if supported, binds the associated functions.

    Parameters

    • context: Context

      WebGL context to query extension support in

    Returns void

Protected queryMaxUniformVec3Components

  • queryMaxUniformVec3Components(context: Context): void
  • Query and store the maximum number of floats, integers, or booleans that can be in storage for a vertex shader.

    Parameters

    • context: Context

      WebGL context to query the value in.

    Returns void

Protected queryTexImageInterface

  • queryTexImageInterface(context: Context): void

Protected queryVertexArrayObjectSupport

  • queryVertexArrayObjectSupport(context: Context): void