CCGLProgram Class Reference
| Inherits from | NSObject |
| Declared in | CCGLProgram.h |
Tasks
-
programproperty -
– initWithVertexShaderByteArray:fragmentShaderByteArray:Initializes the CCGLProgram with a vertex and fragment with bytes array
-
– initWithVertexShaderFilename:fragmentShaderFilename:Initializes the CCGLProgram with a vertex and fragment with contents of filenames
-
– addAttribute:index:It will add a new attribute to the shader
-
– linklinks the glProgram
-
– useit will call glUseProgram()
-
– updateUniformsIt will create 4 uniforms:
- kCCUniformPMatrix - kCCUniformMVMatrix - kCCUniformMVPMatrix - kCCUniformSampler -
– uniformLocationForName:calls retrieves the named uniform location for this shader program.
-
– setUniformLocation:withI1:calls glUniform1i only if the values are different than the previous call for this same shader program.
-
– setUniformLocation:withF1:calls glUniform1f only if the values are different than the previous call for this same shader program.
-
– setUniformLocation:withF1:f2:calls glUniform2f only if the values are different than the previous call for this same shader program.
-
– setUniformLocation:withF1:f2:f3:calls glUniform3f only if the values are different than the previous call for this same shader program.
-
– setUniformLocation:withF1:f2:f3:f4:calls glUniform4f only if the values are different than the previous call for this same shader program.
-
– setUniformLocation:with2fv:count:calls glUniform2fv only if the values are different than the previous call for this same shader program.
-
– setUniformLocation:with3fv:count:calls glUniform3fv only if the values are different than the previous call for this same shader program.
-
– setUniformLocation:with4fv:count:calls glUniform4fv only if the values are different than the previous call for this same shader program.
-
– setUniformLocation:withMatrix4fv:count:calls glUniformMatrix4fv only if the values are different than the previous call for this same shader program.
-
– setUniformsForBuiltinswill update the builtin uniforms if they are different than the previous call for this same shader program.
-
– setUniformForModelViewProjectionMatrixDeprecated alias for setUniformsForBuiltins
-
– vertexShaderLogreturns the vertexShader error log
-
– fragmentShaderLogreturns the fragmentShader error log
-
– programLogreturns the program error log
Instance Methods
addAttribute:index:
It will add a new attribute to the shader
- (void)addAttribute:(NSString *)attributeName index:(GLuint)indexDeclared In
CCGLProgram.hfragmentShaderLog
returns the fragmentShader error log
- (NSString *)fragmentShaderLogDeclared In
CCGLProgram.hinitWithVertexShaderByteArray:fragmentShaderByteArray:
Initializes the CCGLProgram with a vertex and fragment with bytes array
- (id)initWithVertexShaderByteArray:(const GLchar *)vShaderByteArray fragmentShaderByteArray:(const GLchar *)fShaderByteArrayDeclared In
CCGLProgram.hinitWithVertexShaderFilename:fragmentShaderFilename:
Initializes the CCGLProgram with a vertex and fragment with contents of filenames
- (id)initWithVertexShaderFilename:(NSString *)vShaderFilename fragmentShaderFilename:(NSString *)fShaderFilenameDeclared In
CCGLProgram.hsetUniformForModelViewProjectionMatrix
Deprecated alias for setUniformsForBuiltins
- (void)setUniformForModelViewProjectionMatrixDeclared In
CCGLProgram.hsetUniformLocation:with2fv:count:
calls glUniform2fv only if the values are different than the previous call for this same shader program.
- (void)setUniformLocation:(GLint)location with2fv:(GLfloat *)floats count:(NSUInteger)numberOfArraysDeclared In
CCGLProgram.hsetUniformLocation:with3fv:count:
calls glUniform3fv only if the values are different than the previous call for this same shader program.
- (void)setUniformLocation:(GLint)location with3fv:(GLfloat *)floats count:(NSUInteger)numberOfArraysDeclared In
CCGLProgram.hsetUniformLocation:with4fv:count:
calls glUniform4fv only if the values are different than the previous call for this same shader program.
- (void)setUniformLocation:(GLint)location with4fv:(GLvoid *)floats count:(NSUInteger)numberOfArraysDeclared In
CCGLProgram.hsetUniformLocation:withF1:
calls glUniform1f only if the values are different than the previous call for this same shader program.
- (void)setUniformLocation:(GLint)location withF1:(GLfloat)f1Declared In
CCGLProgram.hsetUniformLocation:withF1:f2:
calls glUniform2f only if the values are different than the previous call for this same shader program.
- (void)setUniformLocation:(GLint)location withF1:(GLfloat)f1 f2:(GLfloat)f2Declared In
CCGLProgram.hsetUniformLocation:withF1:f2:f3:
calls glUniform3f only if the values are different than the previous call for this same shader program.
- (void)setUniformLocation:(GLint)location withF1:(GLfloat)f1 f2:(GLfloat)f2 f3:(GLfloat)f3Declared In
CCGLProgram.hsetUniformLocation:withF1:f2:f3:f4:
calls glUniform4f only if the values are different than the previous call for this same shader program.
- (void)setUniformLocation:(GLint)location withF1:(GLfloat)f1 f2:(GLfloat)f2 f3:(GLfloat)f3 f4:(GLfloat)f4Declared In
CCGLProgram.hsetUniformLocation:withI1:
calls glUniform1i only if the values are different than the previous call for this same shader program.
- (void)setUniformLocation:(GLint)location withI1:(GLint)i1Declared In
CCGLProgram.hsetUniformLocation:withMatrix4fv:count:
calls glUniformMatrix4fv only if the values are different than the previous call for this same shader program.
- (void)setUniformLocation:(GLint)location withMatrix4fv:(GLvoid *)matrix_array count:(NSUInteger)numberOfMatrixDeclared In
CCGLProgram.hsetUniformsForBuiltins
will update the builtin uniforms if they are different than the previous call for this same shader program.
- (void)setUniformsForBuiltinsDeclared In
CCGLProgram.huniformLocationForName:
calls retrieves the named uniform location for this shader program.
- (GLint)uniformLocationForName:(NSString *)nameDeclared In
CCGLProgram.h