Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ManagedShader

Provides abstraction of shader instance. If specified shader source was instanced already, delegate actual instance. And counts reference of shader and if that shader was released and the count is zero, this shader resource would be deleted automatically.

DO NOT instanciate this class directly. Use getShader method instead.

Hierarchy

Index

Constructors

constructor

  • new ManagedShader(gl: WebGLRenderingContext, type: number, sourceCode: string, hash: number): ManagedShader

Properties

destroyed

destroyed: boolean = false

gl

gl: WebGLRenderingContext

hash

hash: number

index

index: number

resourceReference

resourceReference: WebGLShader

sourceCode

sourceCode: string

type

type: number

validPromise

validPromise: Promise<GLResource<WebGLShader>>

Accessors

metadata

  • get metadata(): object

valid

  • get valid(): boolean
  • set valid(val: boolean): void

Methods

destroy

  • destroy(): void

release

  • release(): void
  • Release shader instance from reference. Do not call this method dupelicately per a getShader call.

    That would make this shader disposed unintendedly.

    Returns void

setMetadata

  • setMetadata(key: string, value: any): void

update

  • update(source: string): void

Static getShader

  • getShader(gl: WebGLRenderingContext, type: number, shader: string): ManagedShader

Generated using TypeDoc