CCGLProgram Class that implements a glProgram. More...
#include <CCGLProgram.h>
Public Member Functions | |
CCGLProgram () | |
ctor () | |
virtual | ~CCGLProgram () |
bool | initWithVertexShaderByteArray (const GLchar *vShaderByteArray, const GLchar *fShaderByteArray) |
Initializes the CCGLProgram with a vertex and fragment with bytes array. More... | |
var | initWithString ( var vShaderByteArray, var fShaderByteArray) |
Initializes the CCGLProgram with a vertex and fragment with bytes array. More... | |
bool | initWithPrecompiledProgramByteArray (const GLchar *vShaderByteArray, const GLchar *fShaderByteArray) |
Initializes the CCGLProgram with precompiled shader program. More... | |
local | initWithPrecompiledProgramByteArray ( local vShaderByteArray, local fShaderByteArray) |
Initializes the CCGLProgram with precompiled shader program. More... | |
bool | initWithVertexShaderFilename (const char *vShaderFilename, const char *fShaderFilename) |
Initializes the CCGLProgram with a vertex and fragment with contents of filenames. More... | |
void | addAttribute (const char *attributeName, GLuint index) |
It will add a new attribute to the shader. More... | |
var | addAttribute ( var attributeName, var index) |
It will add a new attribute to the shader. More... | |
bool | link () |
links the glProgram More... | |
void | use () |
it will call glUseProgram() More... | |
var | use () |
it will call glUseProgram() More... | |
void | updateUniforms () |
It will create 4 uniforms: More... | |
var | updateUniforms () |
It will create 4 uniforms: More... | |
GLint | getUniformLocationForName (const char *name) |
calls retrieves the named uniform location for this shader program. More... | |
var | getUniformLocationForName ( var name) |
calls retrieves the named uniform location for this shader program. More... | |
void | setUniformLocationWith1i (GLint location, GLint i1) |
calls glUniform1i only if the values are different than the previous call for this same shader program. More... | |
void | setUniformLocationWith2i (GLint location, GLint i1, GLint i2) |
calls glUniform2i only if the values are different than the previous call for this same shader program. More... | |
void | setUniformLocationWith3i (GLint location, GLint i1, GLint i2, GLint i3) |
calls glUniform3i only if the values are different than the previous call for this same shader program. More... | |
var | setUniformLocationWith3i ( var location, var i1, var i2, var i3) |
calls glUniform3i only if the values are different than the previous call for this same shader program. More... | |
void | setUniformLocationWith4i (GLint location, GLint i1, GLint i2, GLint i3, GLint i4) |
calls glUniform4i only if the values are different than the previous call for this same shader program. More... | |
void | setUniformLocationWith2iv (GLint location, GLint *ints, unsigned int numberOfArrays) |
calls glUniform2iv only if the values are different than the previous call for this same shader program. More... | |
var | setUniformLocationWith2iv ( var location, var ints, var numberOfArrays) |
calls glUniform2iv only if the values are different than the previous call for this same shader program. More... | |
void | setUniformLocationWith3iv (GLint location, GLint *ints, unsigned int numberOfArrays) |
calls glUniform3iv only if the values are different than the previous call for this same shader program. More... | |
var | setUniformLocationWith3iv ( var location, var ints, var numberOfArrays) |
calls glUniform3iv only if the values are different than the previous call for this same shader program. More... | |
void | setUniformLocationWith4iv (GLint location, GLint *ints, unsigned int numberOfArrays) |
calls glUniform4iv only if the values are different than the previous call for this same shader program. More... | |
var | setUniformLocationWith4iv ( var location, var ints, var numberOfArrays) |
calls glUniform4iv only if the values are different than the previous call for this same shader program. More... | |
void | setUniformLocationWith1f (GLint location, GLfloat f1) |
calls glUniform1f only if the values are different than the previous call for this same shader program. More... | |
void | setUniformLocationWith2f (GLint location, GLfloat f1, GLfloat f2) |
calls glUniform2f only if the values are different than the previous call for this same shader program. More... | |
var | setUniformLocationF32 ( var location, var f1, var f2) |
calls glUniform2f only if the values are different than the previous call for this same shader program. More... | |
void | setUniformLocationWith3f (GLint location, GLfloat f1, GLfloat f2, GLfloat f3) |
calls glUniform3f only if the values are different than the previous call for this same shader program. More... | |
void | setUniformLocationWith4f (GLint location, GLfloat f1, GLfloat f2, GLfloat f3, GLfloat f4) |
calls glUniform4f only if the values are different than the previous call for this same shader program. More... | |
void | setUniformLocationWith2fv (GLint location, GLfloat *floats, unsigned int numberOfArrays) |
calls glUniform2fv only if the values are different than the previous call for this same shader program. More... | |
void | setUniformLocationWith3fv (GLint location, GLfloat *floats, unsigned int numberOfArrays) |
calls glUniform3fv only if the values are different than the previous call for this same shader program. More... | |
void | setUniformLocationWith4fv (GLint location, GLfloat *floats, unsigned int numberOfArrays) |
calls glUniform4fv only if the values are different than the previous call for this same shader program. More... | |
void | setUniformLocationWithMatrix4fv (GLint location, GLfloat *matrixArray, unsigned int numberOfMatrices) |
calls glUniformMatrix4fv only if the values are different than the previous call for this same shader program. More... | |
void | setUniformsForBuiltins () |
will update the builtin uniforms if they are different than the previous call for this same shader program. More... | |
var | setUniformsForBuiltins () |
will update the builtin uniforms if they are different than the previous call for this same shader program. More... | |
const char * | vertexShaderLog () |
returns the vertexShader error log More... | |
const char * | fragmentShaderLog () |
returns the fragmentShader error log More... | |
const char * | programLog () |
returns the program error log More... | |
void | reset () |
reload all shaders, this function is designed for android when opengl context lost, so don't call it. More... | |
var | reset () |
reload all shaders, this function is designed for android when opengl context lost, so don't call it. More... | |
const GLuint | getProgram () |
![]() | |
CCObject (void) | |
virtual | ~CCObject (void) |
void | release (void) |
void | retain (void) |
CCObject * | autorelease (void) |
CCObject * | copy (void) |
bool | isSingleReference (void) const |
unsigned int | retainCount (void) const |
virtual bool | isEqual (const CCObject *pObject) |
virtual void | acceptVisitor (CCDataVisitor &visitor) |
virtual void | update (float dt) |
![]() | |
virtual CCObject * | copyWithZone (CCZone *pZone) |
Additional Inherited Members | |
![]() | |
unsigned int | m_uID |
int | m_nLuaID |
![]() | |
unsigned int | m_uReference |
unsigned int | m_uAutoReleaseCount |
CCGLProgram Class that implements a glProgram.
CCGLProgram | ( | ) |
var ctor | ( | ) |
|
virtual |
void addAttribute | ( | const char * | attributeName, |
GLuint | index | ||
) |
It will add a new attribute to the shader.
var addAttribute | ( | var | attributeName, |
var | index | ||
) |
It will add a new attribute to the shader.
const char* fragmentShaderLog | ( | ) |
returns the fragmentShader error log
var getFragmentShaderLog | ( | ) |
returns the fragmentShader error log
|
inline |
|
inline |
GLint getUniformLocationForName | ( | const char * | name) |
calls retrieves the named uniform location for this shader program.
var getUniformLocationForName | ( | var | name) |
calls retrieves the named uniform location for this shader program.
bool initWithPrecompiledProgramByteArray |
( | const GLchar * | vShaderByteArray, |
const GLchar * | fShaderByteArray | ||
) |
Initializes the CCGLProgram with precompiled shader program.
var initWithPrecompiledProgramByteArray |
( | var | vShaderByteArray, |
var | fShaderByteArray | ||
) |
Initializes the CCGLProgram with precompiled shader program.
local initWithPrecompiledProgramByteArray |
( | local | vShaderByteArray, |
local | fShaderByteArray | ||
) |
Initializes the CCGLProgram with precompiled shader program.
bool initWithVertexShaderByteArray | ( | const GLchar * | vShaderByteArray, |
const GLchar * | fShaderByteArray | ||
) |
Initializes the CCGLProgram with a vertex and fragment with bytes array.
var initWithString | ( | var | vShaderByteArray, |
var | fShaderByteArray | ||
) |
Initializes the CCGLProgram with a vertex and fragment with bytes array.
bool initWithVertexShaderFilename | ( | const char * | vShaderFilename, |
const char * | fShaderFilename | ||
) |
Initializes the CCGLProgram with a vertex and fragment with contents of filenames.
var init | ( | var | vShaderFilename, |
var | fShaderFilename | ||
) |
Initializes the CCGLProgram with a vertex and fragment with contents of filenames.
bool link | ( | ) |
links the glProgram
var link | ( | ) |
links the glProgram
const char* programLog | ( | ) |
returns the program error log
var getProgramLog | ( | ) |
returns the program error log
void reset | ( | ) |
reload all shaders, this function is designed for android when opengl context lost, so don't call it.
var reset | ( | ) |
reload all shaders, this function is designed for android when opengl context lost, so don't call it.
void setUniformLocationWith1f | ( | GLint | location, |
GLfloat | f1 | ||
) |
calls glUniform1f only if the values are different than the previous call for this same shader program.
var setUniformLocationF32 | ( | var | location, |
var | f1 | ||
) |
calls glUniform1f only if the values are different than the previous call for this same shader program.
void setUniformLocationWith1i | ( | GLint | location, |
GLint | i1 | ||
) |
calls glUniform1i only if the values are different than the previous call for this same shader program.
var setUniformLocationI32 | ( | var | location, |
var | i1 | ||
) |
calls glUniform1i only if the values are different than the previous call for this same shader program.
void setUniformLocationWith2f | ( | GLint | location, |
GLfloat | f1, | ||
GLfloat | f2 | ||
) |
calls glUniform2f only if the values are different than the previous call for this same shader program.
var setUniformLocationF32 | ( | var | location, |
var | f1, | ||
var | f2 | ||
) |
calls glUniform2f only if the values are different than the previous call for this same shader program.
void setUniformLocationWith2fv | ( | GLint | location, |
GLfloat * | floats, | ||
unsigned int | numberOfArrays | ||
) |
calls glUniform2fv only if the values are different than the previous call for this same shader program.
void setUniformLocationWith2i | ( | GLint | location, |
GLint | i1, | ||
GLint | i2 | ||
) |
calls glUniform2i only if the values are different than the previous call for this same shader program.
var setUniformLocationWith2i | ( | var | location, |
var | i1, | ||
var | i2 | ||
) |
calls glUniform2i only if the values are different than the previous call for this same shader program.
void setUniformLocationWith2iv | ( | GLint | location, |
GLint * | ints, | ||
unsigned int | numberOfArrays | ||
) |
calls glUniform2iv only if the values are different than the previous call for this same shader program.
var setUniformLocationWith2iv | ( | var | location, |
var | ints, | ||
var | numberOfArrays | ||
) |
calls glUniform2iv only if the values are different than the previous call for this same shader program.
void setUniformLocationWith3f | ( | GLint | location, |
GLfloat | f1, | ||
GLfloat | f2, | ||
GLfloat | f3 | ||
) |
calls glUniform3f only if the values are different than the previous call for this same shader program.
var setUniformLocationF32 | ( | var | location, |
var | f1, | ||
var | f2, | ||
var | f3 | ||
) |
calls glUniform3f only if the values are different than the previous call for this same shader program.
void setUniformLocationWith3fv | ( | GLint | location, |
GLfloat * | floats, | ||
unsigned int | numberOfArrays | ||
) |
calls glUniform3fv only if the values are different than the previous call for this same shader program.
void setUniformLocationWith3i | ( | GLint | location, |
GLint | i1, | ||
GLint | i2, | ||
GLint | i3 | ||
) |
calls glUniform3i only if the values are different than the previous call for this same shader program.
var setUniformLocationWith3i | ( | var | location, |
var | i1, | ||
var | i2, | ||
var | i3 | ||
) |
calls glUniform3i only if the values are different than the previous call for this same shader program.
void setUniformLocationWith3iv | ( | GLint | location, |
GLint * | ints, | ||
unsigned int | numberOfArrays | ||
) |
calls glUniform3iv only if the values are different than the previous call for this same shader program.
var setUniformLocationWith3iv | ( | var | location, |
var | ints, | ||
var | numberOfArrays | ||
) |
calls glUniform3iv only if the values are different than the previous call for this same shader program.
void setUniformLocationWith4f | ( | GLint | location, |
GLfloat | f1, | ||
GLfloat | f2, | ||
GLfloat | f3, | ||
GLfloat | f4 | ||
) |
calls glUniform4f only if the values are different than the previous call for this same shader program.
var setUniformLocationF32 | ( | var | location, |
var | f1, | ||
var | f2, | ||
var | f3, | ||
var | f4 | ||
) |
calls glUniform4f only if the values are different than the previous call for this same shader program.
void setUniformLocationWith4fv | ( | GLint | location, |
GLfloat * | floats, | ||
unsigned int | numberOfArrays | ||
) |
calls glUniform4fv only if the values are different than the previous call for this same shader program.
void setUniformLocationWith4i | ( | GLint | location, |
GLint | i1, | ||
GLint | i2, | ||
GLint | i3, | ||
GLint | i4 | ||
) |
calls glUniform4i only if the values are different than the previous call for this same shader program.
var setUniformLocationWith4i | ( | var | location, |
var | i1, | ||
var | i2, | ||
var | i3, | ||
var | i4 | ||
) |
calls glUniform4i only if the values are different than the previous call for this same shader program.
void setUniformLocationWith4iv | ( | GLint | location, |
GLint * | ints, | ||
unsigned int | numberOfArrays | ||
) |
calls glUniform4iv only if the values are different than the previous call for this same shader program.
var setUniformLocationWith4iv | ( | var | location, |
var | ints, | ||
var | numberOfArrays | ||
) |
calls glUniform4iv only if the values are different than the previous call for this same shader program.
void setUniformLocationWithMatrix4fv |
( | GLint | location, |
GLfloat * | matrixArray, | ||
unsigned int | numberOfMatrices | ||
) |
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.
var setUniformsForBuiltins | ( | ) |
will update the builtin uniforms if they are different than the previous call for this same shader program.
void updateUniforms | ( | ) |
It will create 4 uniforms:
And it will bind "kCCUniformSampler" to 0
var updateUniforms | ( | ) |
It will create 4 uniforms:
And it will bind "kCCUniformSampler" to 0
void use | ( | ) |
it will call glUseProgram()
var use | ( | ) |
it will call glUseProgram()
const char* vertexShaderLog | ( | ) |
returns the vertexShader error log
var getVertexShaderLog | ( | ) |
returns the vertexShader error log