|
cocos2d-iphone
2.1
Improved Cocos2D API Reference (iOS version) for www.koboldtouch.com developers
|
#import <CCGLProgram.h>
Instance Methods | |
| (id) | - initWithVertexShaderByteArray:fragmentShaderByteArray: |
| (id) | - initWithVertexShaderFilename:fragmentShaderFilename: |
| (void) | - addAttribute:index: |
| (BOOL) | - link |
| (void) | - use |
| (void) | - updateUniforms |
| (GLint) | - uniformLocationForName: |
| (void) | - setUniformLocation:withI1: |
| (void) | - setUniformLocation:withF1: |
| (void) | - setUniformLocation:withF1:f2: |
| (void) | - setUniformLocation:withF1:f2:f3: |
| (void) | - setUniformLocation:withF1:f2:f3:f4: |
| (void) | - setUniformLocation:with2fv:count: |
| (void) | - setUniformLocation:with3fv:count: |
| (void) | - setUniformLocation:with4fv:count: |
| (void) | - setUniformLocation:withMatrix4fv:count: |
| (void) | - setUniformsForBuiltins |
| ((__deprecated__) | - __attribute__ |
| (NSString *) | - vertexShaderLog |
| (NSString *) | - fragmentShaderLog |
| (NSString *) | - programLog |
Class Methods | |
| (id) | + programWithVertexShaderByteArray:fragmentShaderByteArray: |
| (id) | + programWithVertexShaderFilename:fragmentShaderFilename: |
Protected Attributes | |
| struct _hashUniformEntry * | _hashForUniforms |
Properties | |
| GLuint | program |
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
| + (id) programWithVertexShaderByteArray: | (const GLchar *) | vShaderByteArray | |
| fragmentShaderByteArray: | (const GLchar *) | fShaderByteArray | |
creates the CCGLProgram with a vertex and fragment from byte arrays
| + (id) programWithVertexShaderFilename: | (NSString *) | vShaderFilename | |
| fragmentShaderFilename: | (NSString *) | fShaderFilename | |
creates the CCGLProgram with a vertex and fragment with contents of filenames
| - (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