GLProgramState holds the 'state' (uniforms and attributes) of the GLProgram.
More...
#include <CCGLProgramState.h>
|
| void | apply (const Mat4 &modelView) |
| void | setGLProgram (GLProgram *glprogram) |
| GLProgram * | getGLProgram () const |
| uint32_t | getVertexAttribsFlags () const |
| ssize_t | getVertexAttribCount () const |
| void | setVertexAttribCallback (const std::string &name, const std::function< void(VertexAttrib *)> &callback) |
| void | setVertexAttribPointer (const std::string &name, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLvoid *pointer) |
| ssize_t | getUniformCount () const |
| void | setUniformInt (const std::string &uniformName, int value) |
| void | setUniformFloat (const std::string &uniformName, float value) |
| void | setUniformVec2 (const std::string &uniformName, const Vec2 &value) |
| void | setUniformVec3 (const std::string &uniformName, const Vec3 &value) |
| void | setUniformVec4 (const std::string &uniformName, const Vec4 &value) |
| void | setUniformMat4 (const std::string &uniformName, const Mat4 &value) |
| void | setUniformCallback (const std::string &uniformName, const std::function< void(Uniform *)> &callback) |
| void | setUniformTexture (const std::string &uniformName, Texture2D *texture) |
| void | setUniformTexture (const std::string &uniformName, GLuint textureId) |
| void | retain () |
| | Retains the ownership. More...
|
| |
| void | release () |
| | Releases the ownership immediately. More...
|
| |
| Ref * | autorelease () |
| | Releases the ownership sometime soon automatically. More...
|
| |
| unsigned int | getReferenceCount () const |
| | Returns the Ref's current reference count. More...
|
| |
| virtual | ~Ref () |
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
| void apply |
( |
const Mat4 & |
modelView | ) |
|
static GLProgramState*
getOrCreateWithGLProgramName |
( |
const std::string & |
glProgramName | ) |
|
|
static |
gets-or-creates an instance of GLProgramState for a given GLProgramName
| UniformValue* getUniformValue |
( |
const std::string & |
uniformName | ) |
|
|
protected |
| ssize_t getVertexAttribCount |
( |
| ) |
const |
|
inline |
| uint32_t getVertexAttribsFlags |
( |
| ) |
const |
|
inline |
| void setUniformCallback |
( |
const std::string & |
uniformName, |
|
|
const std::function< void(Uniform *)> & |
callback |
|
) |
| |
| void setUniformFloat |
( |
const std::string & |
uniformName, |
|
|
float |
value |
|
) |
| |
| void setUniformInt |
( |
const std::string & |
uniformName, |
|
|
int |
value |
|
) |
| |
| void setUniformMat4 |
( |
const std::string & |
uniformName, |
|
|
const Mat4 & |
value |
|
) |
| |
| void setUniformTexture |
( |
const std::string & |
uniformName, |
|
|
Texture2D * |
texture |
|
) |
| |
| void setUniformTexture |
( |
const std::string & |
uniformName, |
|
|
GLuint |
textureId |
|
) |
| |
| void setUniformVec2 |
( |
const std::string & |
uniformName, |
|
|
const Vec2 & |
value |
|
) |
| |
| void setUniformVec3 |
( |
const std::string & |
uniformName, |
|
|
const Vec3 & |
value |
|
) |
| |
| void setUniformVec4 |
( |
const std::string & |
uniformName, |
|
|
const Vec4 & |
value |
|
) |
| |
| void setVertexAttribCallback |
( |
const std::string & |
name, |
|
|
const std::function< void(VertexAttrib *)> & |
callback |
|
) |
| |
| void setVertexAttribPointer |
( |
const std::string & |
name, |
|
|
GLint |
size, |
|
|
GLenum |
type, |
|
|
GLboolean |
normalized, |
|
|
GLsizei |
stride, |
|
|
GLvoid * |
pointer |
|
) |
| |
The documentation for this class was generated from the following file: