GLProgramState holds the 'state' (uniforms and attributes) of the GLProgram.
More...
|
unsigned int | _ID |
| object id, ScriptSupport need public _ID
|
|
int | _luaID |
| Lua reference id.
|
|
void * | _scriptObject |
| scriptObject, support for swift
|
|
bool | _rooted |
| When true, it means that the object was already rooted.
|
|
GLProgramState holds the 'state' (uniforms and attributes) of the GLProgram.
A GLProgram can be used by thousands of Nodes, but if different uniform values are going to be used, then each node will need its own GLProgramState
◆ clone()
◆ apply()
void apply |
( |
const Mat4 & |
modelView | ) |
|
Apply GLProgram, attributes and uniforms.
- Parameters
-
modelView | The applied modelView matrix to shader. |
◆ applyGLProgram()
void applyGLProgram |
( |
const Mat4 & |
modelView | ) |
|
Apply GLProgram, and built in uniforms.
- Parameters
-
modelView | The applied modelView matrix to shader. |
◆ applyAttributes()
void applyAttributes |
( |
bool |
applyAttribFlags = true | ) |
|
Apply attributes.
- Parameters
-
applyAttribFlags | Call GL::enableVertexAttribs(_vertexAttribsFlags) or not. |
◆ setGLProgram()
Setter and Getter of the owner GLProgram binded in this program state.
◆ getVertexAttribsFlags()
uint32_t getVertexAttribsFlags |
( |
| ) |
const |
Get the flag of vertex attribs used by OR operation.
◆ getVertexAttribCount()
ssize_t getVertexAttribCount |
( |
| ) |
const |
Get the number of vertex attributes.
◆ setVertexAttribCallback()
void setVertexAttribCallback |
( |
const std::string & |
name, |
|
|
const std::function< void(VertexAttrib *)> & |
callback |
|
) |
| |
Set the vertex attribute value.
◆ getUniformCount()
ssize_t getUniformCount |
( |
| ) |
const |
|
inline |
Get the number of user defined uniform count.
◆ setUniformInt() [1/2]
void setUniformInt |
( |
const std::string & |
uniformName, |
|
|
int |
value |
|
) |
| |
Setting user defined uniforms by uniform string name in the shader.
◆ setUniformTexture() [1/2]
void setUniformTexture |
( |
const std::string & |
uniformName, |
|
|
GLuint |
textureId |
|
) |
| |
◆ setUniformInt() [2/2]
void setUniformInt |
( |
GLint |
uniformLocation, |
|
|
int |
value |
|
) |
| |
Setting user defined uniforms by uniform location in the shader.
◆ setUniformTexture() [2/2]
void setUniformTexture |
( |
GLint |
uniformLocation, |
|
|
GLuint |
textureId |
|
) |
| |
◆ setNodeBinding()
void setNodeBinding |
( |
Node * |
node | ) |
|
Sets the node that this render state is bound to.
The specified node is used to apply auto-bindings for the render state. This is typically set to the node of the model that a material is applied to.
- Parameters
-
node | The node to use for applying auto-bindings. |
◆ applyAutoBinding()
void applyAutoBinding |
( |
const std::string & |
uniformName, |
|
|
const std::string & |
autoBinding |
|
) |
| |
Applies the specified custom auto-binding.
- Parameters
-
uniformName | Name of the shader uniform. |
autoBinding | Name of the auto binding. |
◆ setParameterAutoBinding()
void setParameterAutoBinding |
( |
const std::string & |
uniformName, |
|
|
const std::string & |
autoBinding |
|
) |
| |
Sets a uniform auto-binding.
This method parses the passed in autoBinding string and attempts to convert it to an enumeration value. If it matches to one of the predefined strings, it will create a callback to get the correct value at runtime.
- Parameters
-
uniformName | The name of the material parameter to store an auto-binding for. |
autoBinding | A string matching one of the built-in AutoBinding enum constants. |
The documentation for this class was generated from the following file: