Constructor
new ProgramController(handler, program)
- Source
Methods
activate() → {ProgramController}
Activates current shader program.
- Type:
- ProgramController
deactivate()
Deactivate shader program. This is not necessary while activate function used.
drawArrays(mode, numItems) → {ProgramController}
Calls Gl drawArray function.
Name | Type | Description |
---|---|---|
mode | number | Gl draw mode. |
numItems | number | draw items count. |
Returns current shader controller instance.
- Type:
- ProgramController
drawIndexBuffer(mode, buffer) → {ProgramController}
Draw index buffer with this program.
Name | Type | Description |
---|---|---|
mode | number | Gl draw mode |
buffer | WebGLBuffer | Buffer to draw. |
Returns current shader controller instance.
- Type:
- ProgramController
getProgram() → {Program}
Returns controller's shader program.
- Type:
- Program
initialize()
Lazy create program call.
isActive() → {boolean}
Returns program activity.
- Type:
- boolean
remove()
Remove program from handler
set(params) → {ProgramController}
Sets program uniforms and attributes values and return controller instance.
Name | Type | Description |
---|---|---|
params | Record.<string, any> | Object with variable name and value like { value: 12, someArray:[1,2,3], uSampler: texture,... } |
- Type:
- ProgramController