Class

ProgramLibrary

ProgramLibrary()

A class to manage programs/shaders

Constructor

Members

Array.<{data: null, ready: boolean, sources: Array.<string>}>

static cache

Put data in cache due to asynchrone loading

View Source Extra/ProgramLibrary.js, line 200

Array.<{data: string, ready: boolean}>

static chunks

Chunks in cache

View Source Extra/ProgramLibrary.js, line 207

Array.<Program>

static programs

Shaders

View Source Extra/ProgramLibrary.js, line 214

number

static Target

Target
Properties:
Name Type Description
Vertex number
Fragment number

View Source Extra/ProgramLibrary.js, line 221

Methods

static get(name) → {Program}

Get the program with the given name
Parameters:
Name Type Description
name string Program's name

View Source Extra/ProgramLibrary.js, line 16

A Program instance, otherwise null is the program doesn't exist
Program

async static loadFromFile(name, vertexShaderFile, fragmentShaderFile, definesopt) → (nullable) {Program}

Load a new program
Parameters:
Name Type Attributes Description
name string Program's name
vertexShaderFile string Path to the vertex shader file
fragmentShaderFile string Path to the fragment shader file
defines Array.<string> <optional>
An array with defines data

View Source Extra/ProgramLibrary.js, line 35

A Program instance
Program