Class: ProgramController

ProgramController

This is shader program controller that used by hadler object to access the shader program capabilities, like switching program during the rendering. Get access to the program from ...handler.programs. etc.

new ProgramController(handler, program)

Name Type Description
handler Handler Handler.
program Program Shader program.

Classes

ProgramController

Methods

Activates current shader program.
Returns:
Type Description
ProgramController -
Deactivate shader program. This is not necessary while activae function used.
Calls Gl drawArray function.
Name Type Description
mode number Gl draw mode.
numItems number draw items count.
Returns:
Type Description
ProgramController Returns current shader controller instance.

drawIndexBuffer(mode, buffer){ProgramController}

Draw index buffer with this program.
Name Type Description
mode number Gl draw mode
buffer WEBGLBuffer Buffer to draw.
Returns:
Type Description
ProgramController Returns current shader controller instance.

getProgram(){Program}

Returns controller's shader program.
Returns:
Type Description
Program -
Lazy create program call.
Returns program activity.
Returns:
Type Description
boolean -
Remove program from handler
Sets program uniforms and attributes values and return controller instance.
Name Type Description
params Object Object with variable name and value like { value: 12, someArray:[1,2,3], uSampler: texture,... }
Returns:
Type Description
ProgramController -