![]() |
cocos2d-iphone
2.1
Improved Cocos2D API Reference (iOS version) for www.kobold2d.com developers
|
#import <CCGLProgram.h>
CCGLProgram Class that implements a glProgram
- ((__deprecated__) __attribute__ |
Deprecated alias for setUniformsForBuiltins
- (void) addAttribute: | (NSString *) | attributeName | |
index: | (GLuint) | index | |
It will add a new attribute to the shader
- (NSString *) fragmentShaderLog |
returns the fragmentShader error log
- (id) initWithVertexShaderByteArray: | (const GLchar *) | vShaderByteArray | |
fragmentShaderByteArray: | (const GLchar *) | fShaderByteArray | |
Initializes the CCGLProgram with a vertex and fragment with bytes array
- (id) initWithVertexShaderFilename: | (NSString *) | vShaderFilename | |
fragmentShaderFilename: | (NSString *) | fShaderFilename | |
Initializes the CCGLProgram with a vertex and fragment with contents of filenames
- (BOOL) link |
links the glProgram
- (NSString *) programLog |
returns the program error log
- (void) setUniformLocation: | (GLint) | location | |
with2fv: | (GLfloat *) | floats | |
count: | (NSUInteger) | numberOfArrays | |
calls glUniform2fv 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 | |
calls glUniform3fv 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 | |
calls glUniform4fv only if the values are different than the previous call for this same shader program.
- (void) setUniformLocation: | (GLint) | location | |
withF1: | (GLfloat) | f1 | |
calls glUniform1f 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 | |
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 | |
f3: | (GLfloat) | 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 | |
f4: | (GLfloat) | f4 | |
calls glUniform4f only if the values are different than the previous call for this same shader program.
- (void) setUniformLocation: | (GLint) | location | |
withI1: | (GLint) | i1 | |
calls glUniform1i 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 | |
calls glUniformMatrix4fv only if the values are different than the previous call for this same shader program.
- (void) setUniformsForBuiltins |
will update the builtin uniforms if they are different than the previous call for this same shader program.
- (GLint) uniformLocationForName: | (NSString *) | name |
calls retrieves the named uniform location for this shader program.
- (void) updateUniforms |
It will create 4 uniforms:
And it will bind "kCCUniformSampler" to 0
- (void) use |
it will call glUseProgram()
- (NSString *) vertexShaderLog |
returns the vertexShader error log