GLProgramState holds the 'state' (uniforms and attributes) of the GLProgram. More...
#include <CCGLProgramState.h>
Public Member Functions | |
| void | apply (const Mat4 &modelView) |
| void | applyGLProgram (const Mat4 &modelView) |
| var | applyGLProgram ( var modelView) |
| local | applyGLProgram ( local modelView) |
| void | applyAttributes (bool applyAttribFlags=true) |
| apply vertex attributes More... | |
| var | applyAttributes ( var true) |
| apply vertex attributes More... | |
| local | applyAttributes ( local true) |
| apply vertex attributes More... | |
| void | applyUniforms () |
| local | applyUniforms () |
| void | setGLProgram (GLProgram *glprogram) |
| local | setGLProgram ( local glprogram) |
| GLProgram * | getGLProgram () const |
| var | getGLProgram () |
| local | getGLProgram () |
| uint32_t | getVertexAttribsFlags () const |
| local | getVertexAttribsFlags () |
| ssize_t | getVertexAttribCount () const |
| local | getVertexAttribCount () |
| void | setVertexAttribCallback (const std::string &name, const std::function< void(VertexAttrib *)> &callback) |
| var | setVertexAttribCallback ( var name, var callback) |
| local | setVertexAttribCallback ( local name, local callback) |
| void | setVertexAttribPointer (const std::string &name, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLvoid *pointer) |
| var | setVertexAttribPointer ( var name, var size, var type, var normalized, var stride, var pointer) |
| local | setVertexAttribPointer ( local name, local size, local type, local normalized, local stride, local pointer) |
| ssize_t | getUniformCount () const |
| void | setUniformInt (const std::string &uniformName, int value) |
| var | setUniformInt ( var uniformName, var value) |
| local | setUniformInt ( local uniformName, local value) |
| void | setUniformFloat (const std::string &uniformName, float value) |
| local | setUniformFloat ( local uniformName, local value) |
| void | setUniformVec2 (const std::string &uniformName, const Vec2 &value) |
| local | setUniformVec2 ( local uniformName, local value) |
| void | setUniformVec3 (const std::string &uniformName, const Vec3 &value) |
| var | setUniformVec3 ( var uniformName, var value) |
| local | setUniformVec3 ( local uniformName, local value) |
| void | setUniformVec4 (const std::string &uniformName, const Vec4 &value) |
| var | setUniformVec4 ( var uniformName, var value) |
| local | setUniformVec4 ( local uniformName, local value) |
| void | setUniformMat4 (const std::string &uniformName, const Mat4 &value) |
| var | setUniformMat4 ( var uniformName, var value) |
| local | setUniformMat4 ( local uniformName, local value) |
| void | setUniformCallback (const std::string &uniformName, const std::function< void(GLProgram *, Uniform *)> &callback) |
| void | setUniformTexture (const std::string &uniformName, Texture2D *texture) |
| void | setUniformTexture (const std::string &uniformName, GLuint textureId) |
| local | setUniformTexture ( local uniformName, local textureId) |
| void | setUniformInt (GLint uniformLocation, int value) |
| local | setUniformInt ( local uniformLocation, local value) |
| void | setUniformFloat (GLint uniformLocation, float value) |
| local | setUniformFloat ( local uniformLocation, local value) |
| void | setUniformVec2 (GLint uniformLocation, const Vec2 &value) |
| local | setUniformVec2 ( local uniformLocation, local value) |
| void | setUniformVec3 (GLint uniformLocation, const Vec3 &value) |
| local | setUniformVec3 ( local uniformLocation, local value) |
| void | setUniformVec4 (GLint uniformLocation, const Vec4 &value) |
| local | setUniformVec4 ( local uniformLocation, local value) |
| void | setUniformMat4 (GLint uniformLocation, const Mat4 &value) |
| local | setUniformMat4 ( local uniformLocation, local value) |
| void | setUniformCallback (GLint uniformLocation, const std::function< void(GLProgram *, Uniform *)> &callback) |
| void | setUniformTexture (GLint uniformLocation, Texture2D *texture) |
| void | setUniformTexture (GLint uniformLocation, GLuint textureId) |
| local | setUniformTexture ( local uniformLocation, local textureId) |
Public Member Functions inherited from Ref | |
| 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... | |
| local | getReferenceCount () |
| Returns the Ref's current reference count. More... | |
| virtual | ~Ref () |
Static Public Member Functions | |
| static GLProgramState * | create (GLProgram *glprogram) |
| returns a new instance of GLProgramState for a given GLProgram More... | |
| local | create ( local glprogram) |
| returns a new instance of GLProgramState for a given GLProgram More... | |
| static GLProgramState * | getOrCreateWithGLProgram (GLProgram *glprogram) |
| gets-or-creates an instance of GLProgramState for a given GLProgram More... | |
| static GLProgramState * | getOrCreateWithGLProgramName (const std::string &glProgramName) |
| gets-or-creates an instance of GLProgramState for a given GLProgramName More... | |
Protected Member Functions | |
| GLProgramState () | |
| GLProgramState () | |
| ~GLProgramState () | |
| ~GLProgramState () | |
| bool | init (GLProgram *program) |
| var | init ( var program) |
| local | init ( local program) |
| void | resetGLProgram () |
| var | resetGLProgram () |
| local | resetGLProgram () |
| VertexAttribValue * | getVertexAttribValue (const std::string &attributeName) |
| var | getVertexAttribValue ( var attributeName) |
| local | getVertexAttribValue ( local attributeName) |
| UniformValue * | getUniformValue (const std::string &uniformName) |
| local | getUniformValue ( local uniformName) |
| UniformValue * | getUniformValue (GLint uniformLocation) |
Protected Member Functions inherited from Ref | |
| Ref () | |
| Constructor. More... | |
| Ref () | |
| Constructor. More... | |
Protected Attributes | |
| bool | _uniformAttributeValueDirty |
| std::unordered_map < std::string, GLint > | _uniformsByName |
| var | _uniformsByName |
| local | _uniformsByName |
| std::unordered_map< GLint, UniformValue > | _uniforms |
| var | _uniforms |
| local | _uniforms |
| std::unordered_map < std::string, VertexAttribValue > | _attributes |
| var | _attributes |
| local | _attributes |
| std::unordered_map < std::string, int > | _boundTextureUnits |
| var | _boundTextureUnits |
| local | _boundTextureUnits |
| int | _textureUnitIndex |
| var | _textureUnitIndex |
| local | _textureUnitIndex |
| uint32_t | _vertexAttribsFlags |
| local | _vertexAttribsFlags |
| GLProgram * | _glprogram |
| var | _glprogram |
| local | _glprogram |
| EventListenerCustom * | _backToForegroundlistener |
| var | _backToForegroundlistener |
| local | _backToForegroundlistener |
Protected Attributes inherited from Ref | |
| unsigned int | _referenceCount |
| count of references More... | |
| local | _referenceCount |
| count of references More... | |
Friends | |
| class | GLProgramStateCache |
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
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
| void apply | ( | const Mat4 & | modelView | ) |
| var apply | ( | var | modelView | ) |
| local apply | ( | local | modelView | ) |
| void applyAttributes | ( | bool | applyAttribFlags = true | ) |
apply vertex attributes
| applyAttribFlags | Call GL::enableVertexAttribs(_vertexAttribsFlags) or not |
| var applyAttributes | ( | var | applyAttribFlags = true | ) |
apply vertex attributes
| applyAttribFlags | Call GL::enableVertexAttribs(_vertexAttribsFlags) or not |
| local applyAttributes | ( | local | applyAttribFlags = true | ) |
apply vertex attributes
| applyAttribFlags | Call GL::enableVertexAttribs(_vertexAttribsFlags) or not |
| void applyGLProgram | ( | const Mat4 & | modelView | ) |
| var applyGLProgram | ( | var | modelView | ) |
| local applyGLProgram | ( | local | modelView | ) |
| void applyUniforms | ( | ) |
| var applyUniforms | ( | ) |
| local applyUniforms | ( | ) |
|
static |
returns a new instance of GLProgramState for a given GLProgram
|
static |
returns a new instance of GLProgramState for a given GLProgram
|
static |
returns a new instance of GLProgramState for a given GLProgram
|
inline |
|
inline |
|
inline |
|
static |
gets-or-creates an instance of GLProgramState for a given GLProgram
|
static |
gets-or-creates an instance of GLProgramState for a given GLProgram
|
static |
gets-or-creates an instance of GLProgramState for a given GLProgram
|
static |
gets-or-creates an instance of GLProgramState for a given GLProgramName
|
static |
gets-or-creates an instance of GLProgramState for a given GLProgramName
|
static |
gets-or-creates an instance of GLProgramState for a given GLProgramName
|
inline |
|
inline |
|
inline |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
| void setGLProgram | ( | GLProgram * | glprogram | ) |
| var setGLProgram | ( | var | glprogram | ) |
| local setGLProgram | ( | local | glprogram | ) |
| void setUniformCallback | ( | const std::string & | uniformName, |
| const std::function< void(GLProgram *, Uniform *)> & | callback | ||
| ) |
| var setUniformCallback | ( | var | uniformName, |
| var | callback | ||
| ) |
| local setUniformCallback | ( | local | uniformName, |
| local | callback | ||
| ) |
| void setUniformCallback | ( | GLint | uniformLocation, |
| const std::function< void(GLProgram *, Uniform *)> & | callback | ||
| ) |
| var setUniformCallback | ( | var | uniformLocation, |
| var | callback | ||
| ) |
| local setUniformCallback | ( | local | uniformLocation, |
| local | callback | ||
| ) |
| void setUniformFloat | ( | const std::string & | uniformName, |
| float | value | ||
| ) |
| var setUniformFloat | ( | var | uniformName, |
| var | value | ||
| ) |
| local setUniformFloat | ( | local | uniformName, |
| local | value | ||
| ) |
| void setUniformFloat | ( | GLint | uniformLocation, |
| float | value | ||
| ) |
| var setUniformFloat | ( | var | uniformLocation, |
| var | value | ||
| ) |
| local setUniformFloat | ( | local | uniformLocation, |
| local | value | ||
| ) |
| void setUniformInt | ( | const std::string & | uniformName, |
| int | value | ||
| ) |
| var setUniformInt | ( | var | uniformName, |
| var | value | ||
| ) |
| local setUniformInt | ( | local | uniformName, |
| local | value | ||
| ) |
| void setUniformInt | ( | GLint | uniformLocation, |
| int | value | ||
| ) |
| var setUniformInt | ( | var | uniformLocation, |
| var | value | ||
| ) |
| local setUniformInt | ( | local | uniformLocation, |
| local | value | ||
| ) |
| void setUniformMat4 | ( | const std::string & | uniformName, |
| const Mat4 & | value | ||
| ) |
| var setUniformMat4 | ( | var | uniformName, |
| var | value | ||
| ) |
| local setUniformMat4 | ( | local | uniformName, |
| local | value | ||
| ) |
| void setUniformMat4 | ( | GLint | uniformLocation, |
| const Mat4 & | value | ||
| ) |
| var setUniformMat4 | ( | var | uniformLocation, |
| var | value | ||
| ) |
| local setUniformMat4 | ( | local | uniformLocation, |
| local | value | ||
| ) |
| void setUniformTexture | ( | const std::string & | uniformName, |
| Texture2D * | texture | ||
| ) |
| var setUniformTexture | ( | var | uniformName, |
| var | texture | ||
| ) |
| local setUniformTexture | ( | local | uniformName, |
| local | texture | ||
| ) |
| void setUniformTexture | ( | const std::string & | uniformName, |
| GLuint | textureId | ||
| ) |
| var setUniformTexture | ( | var | uniformName, |
| var | textureId | ||
| ) |
| local setUniformTexture | ( | local | uniformName, |
| local | textureId | ||
| ) |
| void setUniformTexture | ( | GLint | uniformLocation, |
| Texture2D * | texture | ||
| ) |
| var setUniformTexture | ( | var | uniformLocation, |
| var | texture | ||
| ) |
| local setUniformTexture | ( | local | uniformLocation, |
| local | texture | ||
| ) |
| void setUniformTexture | ( | GLint | uniformLocation, |
| GLuint | textureId | ||
| ) |
| var setUniformTexture | ( | var | uniformLocation, |
| var | textureId | ||
| ) |
| local setUniformTexture | ( | local | uniformLocation, |
| local | textureId | ||
| ) |
| void setUniformVec2 | ( | const std::string & | uniformName, |
| const Vec2 & | value | ||
| ) |
| var setUniformVec2 | ( | var | uniformName, |
| var | value | ||
| ) |
| local setUniformVec2 | ( | local | uniformName, |
| local | value | ||
| ) |
| void setUniformVec2 | ( | GLint | uniformLocation, |
| const Vec2 & | value | ||
| ) |
| var setUniformVec2 | ( | var | uniformLocation, |
| var | value | ||
| ) |
| local setUniformVec2 | ( | local | uniformLocation, |
| local | value | ||
| ) |
| void setUniformVec3 | ( | const std::string & | uniformName, |
| const Vec3 & | value | ||
| ) |
| var setUniformVec3 | ( | var | uniformName, |
| var | value | ||
| ) |
| local setUniformVec3 | ( | local | uniformName, |
| local | value | ||
| ) |
| void setUniformVec3 | ( | GLint | uniformLocation, |
| const Vec3 & | value | ||
| ) |
| var setUniformVec3 | ( | var | uniformLocation, |
| var | value | ||
| ) |
| local setUniformVec3 | ( | local | uniformLocation, |
| local | value | ||
| ) |
| void setUniformVec4 | ( | const std::string & | uniformName, |
| const Vec4 & | value | ||
| ) |
| var setUniformVec4 | ( | var | uniformName, |
| var | value | ||
| ) |
| local setUniformVec4 | ( | local | uniformName, |
| local | value | ||
| ) |
| void setUniformVec4 | ( | GLint | uniformLocation, |
| const Vec4 & | value | ||
| ) |
| var setUniformVec4 | ( | var | uniformLocation, |
| var | value | ||
| ) |
| local setUniformVec4 | ( | local | uniformLocation, |
| local | value | ||
| ) |
| void setVertexAttribCallback | ( | const std::string & | name, |
| const std::function< void(VertexAttrib *)> & | callback | ||
| ) |
| var setVertexAttribCallback | ( | var | name, |
| var | callback | ||
| ) |
| local setVertexAttribCallback | ( | local | name, |
| local | callback | ||
| ) |
| void setVertexAttribPointer | ( | const std::string & | name, |
| GLint | size, | ||
| GLenum | type, | ||
| GLboolean | normalized, | ||
| GLsizei | stride, | ||
| GLvoid * | pointer | ||
| ) |
| var setVertexAttribPointer | ( | var | name, |
| var | size, | ||
| var | type, | ||
| var | normalized, | ||
| var | stride, | ||
| var | pointer | ||
| ) |
| local setVertexAttribPointer | ( | local | name, |
| local | size, | ||
| local | type, | ||
| local | normalized, | ||
| local | stride, | ||
| local | pointer | ||
| ) |
|
friend |
|
friend |
|
friend |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |