Constructor#
new Program(name, material)#
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
name | string | Program name. | |||||||||||||||
material | ProgramMaterial | Object stores uniforms, attributes and program codes: Properties
|
- Source
Methods#
apply()#
Apply current variables.
- Source
createProgram(gl)#
Creates program.
Parameters:
Name | Type | Description |
---|---|---|
gl | Object | WebGl context. |
- Source
delete()#
Delete program.
- Source
disableAttribArrays()#
Disable current program vertexAttribArrays.
- Source
drawArrays(mode, numItems)#
Calls drawArrays function.
Parameters:
Name | Type | Description |
---|---|---|
mode | number | Draw mode GL_TRIANGLES, GL_LINESTRING, etc. |
numItems | number | Items to draw |
- Source
drawIndexBuffer(mode, buffer)#
Calls drawElements index buffer function.
Parameters:
Name | Type | Description |
---|---|---|
mode | number | Draw mode(GL_TRIANGLES, GL_LINESTRING etc.). |
buffer | Object | Index buffer. |
- Source
enableAttribArrays()#
Enable current program vertexAttribArrays.
- Source
set(material)#
Sets program variables.
Parameters:
Name | Type | Description |
---|---|---|
material | Object | Variables and values object. |
- Source
use()#
Sets the current program frame.
- Source
(static) bindBuffer(program, variable)#
Bind program buffer.
Parameters:
Name | Type | Description |
---|---|---|
program | Program | Used program. |
variable | Object | Variable represents buffer data. |
- Source