Skip to main content

TProgram

Implements

  • IAsset

Index

Constructors

constructor

Properties

publicattribLocations

attribLocations: any = {}

publiccompiled

compiled: boolean = false

Boolean to save whether the program has been compiled yet.

publicoptionalprogram

program?: WebGLProgram

publicuniformLocations

uniformLocations: any = {}

publicoptionaluuid

uuid?: string

Methods

publiccompile

  • compile(gl: WebGL2RenderingContext): void
  • Compile the current program given a GLContext


    Parameters

    • gl: WebGL2RenderingContext

    Returns void

publicgetAttributeLocations

  • getAttributeLocations(gl: WebGL2RenderingContext, attributes: string[]): WebGLUniformLocation[]
  • Parameters

    • gl: WebGL2RenderingContext
    • attributes: string[]

    Returns WebGLUniformLocation[]

publicgetUniformLocation

  • getUniformLocation(gl: WebGL2RenderingContext, name: string): WebGLUniformLocation
  • Parameters

    • gl: WebGL2RenderingContext
    • name: string

    Returns WebGLUniformLocation

publicgetUniformOffsets

  • getUniformOffsets(gl: WebGL2RenderingContext, uniforms: string[]): number[]
  • Parameters

    • gl: WebGL2RenderingContext
    • uniforms: string[]

    Returns number[]

publicload

  • load(response: Response): Promise<void>
  • Parameters

    • response: Response

    Returns Promise<void>

publicstaticfrom

  • Parameters

    • shader: TShader

    Returns default