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
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
getMTime() → {number}
- Description:
Return modified time of the object.
- Source:
- Inherited From:
Returns:
- Type
- number
modified()
- Description:
Mark the object modified.
- Source:
- Inherited From:
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