CCGLProgram Class Reference
Inherits from | NSObject |
Declared in | CCGLProgram.h |
Tasks
-
program
property -
– 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
-
– link
links the glProgram
-
– use
it will call glUseProgram()
-
– updateUniforms
It 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.
-
– setUniformsForBuiltins
will update the builtin uniforms if they are different than the previous call for this same shader program.
-
– setUniformForModelViewProjectionMatrix
Deprecated alias for setUniformsForBuiltins
-
– vertexShaderLog
returns the vertexShader error log
-
– fragmentShaderLog
returns the fragmentShader error log
-
– programLog
returns the program error log
Instance Methods
addAttribute:index:
It will add a new attribute to the shader
- (void)addAttribute:(NSString *)attributeName index:(GLuint)index
Declared In
CCGLProgram.h
fragmentShaderLog
returns the fragmentShader error log
- (NSString *)fragmentShaderLog
Declared In
CCGLProgram.h
initWithVertexShaderByteArray:fragmentShaderByteArray:
Initializes the CCGLProgram with a vertex and fragment with bytes array
- (id)initWithVertexShaderByteArray:(const GLchar *)vShaderByteArray fragmentShaderByteArray:(const GLchar *)fShaderByteArray
Declared In
CCGLProgram.h
initWithVertexShaderFilename:fragmentShaderFilename:
Initializes the CCGLProgram with a vertex and fragment with contents of filenames
- (id)initWithVertexShaderFilename:(NSString *)vShaderFilename fragmentShaderFilename:(NSString *)fShaderFilename
Declared In
CCGLProgram.h
setUniformForModelViewProjectionMatrix
Deprecated alias for setUniformsForBuiltins
- (void)setUniformForModelViewProjectionMatrix
Declared In
CCGLProgram.h
setUniformLocation: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)numberOfArrays
Declared In
CCGLProgram.h
setUniformLocation: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)numberOfArrays
Declared In
CCGLProgram.h
setUniformLocation: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)numberOfArrays
Declared In
CCGLProgram.h
setUniformLocation:withF1:
calls glUniform1f only if the values are different than the previous call for this same shader program.
- (void)setUniformLocation:(GLint)location withF1:(GLfloat)f1
Declared In
CCGLProgram.h
setUniformLocation: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)f2
Declared In
CCGLProgram.h
setUniformLocation: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)f3
Declared In
CCGLProgram.h
setUniformLocation: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)f4
Declared In
CCGLProgram.h
setUniformLocation:withI1:
calls glUniform1i only if the values are different than the previous call for this same shader program.
- (void)setUniformLocation:(GLint)location withI1:(GLint)i1
Declared In
CCGLProgram.h
setUniformLocation: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)numberOfMatrix
Declared In
CCGLProgram.h
setUniformsForBuiltins
will update the builtin uniforms if they are different than the previous call for this same shader program.
- (void)setUniformsForBuiltins
Declared In
CCGLProgram.h
uniformLocationForName:
calls retrieves the named uniform location for this shader program.
- (GLint)uniformLocationForName:(NSString *)name
Declared In
CCGLProgram.h