Options
All
  • Public
  • Public/Protected
  • All
Menu

Module utils/gl-utils

Index

Functions

compileShader

  • compileShader(gl: WebGLRenderingContext, shaderType: GLenum, shaderSource: string): WebGLShader | null
  • Create and compile WebGLShader

    Parameters

    • gl: WebGLRenderingContext
    • shaderType: GLenum
    • shaderSource: string

    Returns WebGLShader | null

createBuffer

  • createBuffer(gl: WebGLRenderingContext, data: Float32Array | Float64Array, usage?: GLenum): WebGLBuffer | null
  • Create a ARRAY_BUFFER buffer

    Parameters

    • gl: WebGLRenderingContext
    • data: Float32Array | Float64Array

      Typed array types that will be copied into the data store

    • usage: GLenum = ...

    Returns WebGLBuffer | null

createIndexBuffer

  • createIndexBuffer(gl: WebGLRenderingContext, indices: Uint16Array | Uint32Array, usage?: GLenum): WebGLBuffer | null
  • Create a ELEMENT_ARRAY_BUFFER buffer

    Parameters

    • gl: WebGLRenderingContext
    • indices: Uint16Array | Uint32Array
    • usage: GLenum = ...

    Returns WebGLBuffer | null

createProgram

  • createProgram(gl: WebGLRenderingContext, vertexShaderSource: string, fragmentShaderSource: string): WebGLProgram | null
  • Create and link WebGLProgram with provided shader strings

    Parameters

    • gl: WebGLRenderingContext
    • vertexShaderSource: string
    • fragmentShaderSource: string

    Returns WebGLProgram | null

getExtension

  • getExtension(gl: WebGLRenderingContext, extensionName: string, caching?: boolean): any
  • Obtains and returns a WebGL extension if available. Caches it in-memory for future use.

    Parameters

    • gl: WebGLRenderingContext
    • extensionName: string
    • caching: boolean = false

    Returns any

Generated using TypeDoc