Class: ProgramController

ProgramController

new ProgramController(handler, program)

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.
Name Type Description
handler og.webgl.Handler Handler.
program og.webgl.Program Shader program.

Methods

Activates current shader program.
Returns:
Type Description
ProgramController -
Deactivate shader program. This is not necessary while activae function used.

drawArrays(mode, numItems){og.webgl.ProgramController}

Calls Gl drawArray function.
Name Type Description
mode number Gl draw mode.
numItems number draw items count.
Returns:
Type Description
og.webgl.ProgramController Returns current shader controller instance.

drawIndexBuffer(mode, buffer){og.webgl.ProgramController}

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

getProgram(){og.webgl.Program}

Returns controller's shader program.
Returns:
Type Description
og.webgl.Program -
Lazy create program call.

isActive(){boolean}

Returns program activity.
Returns:
Type Description
boolean -
Remove program from handler

set(params){og.webgl.ProgramController}

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
og.webgl.ProgramController -