new shader(type) → {vgl.shader}
- Description:
Create a new instance of class shader.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
type |
number | The GL shader type. |
Returns:
- Type
- vgl.shader
Extends
- vgl.object
Methods
attachShader(renderState, programHandle)
- Description:
Attach shader to the program.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
renderState |
vgl.renderState | |
programHandle |
number | GL shader handler. |
compile(renderState) → {number}
- Description:
Compile the shader.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
renderState |
vgl.renderState |
Returns:
GL shader handle.
- Type
- number
removeContext(renderState)
- Description:
Remove the context from the list of tracked contexts. This allows the associated shader handle to be GCed. Does nothing if the context is not in the list of tracked contexts.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
renderState |
vgl.renderState | A renderState that includes a m_context value. |
setShaderSource(source)
- Description:
Set shader source.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
source |
string |
shaderHandle(renderState) → {number}
- Description:
Get shader handle.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
renderState |
vgl.renderState |
Returns:
GL shader handle
- Type
- number