Inherits from NSObject
Declared in CCGLProgram.h

Overview

CCGLProgram Class that implements a glProgram

Tasks

Properties

program

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

link

links the glProgram

- (BOOL)link

Declared In

CCGLProgram.h

programLog

returns the program error log

- (NSString *)programLog

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

updateUniforms

It will create 4 uniforms:

- kCCUniformPMatrix
- kCCUniformMVMatrix
- kCCUniformMVPMatrix
- kCCUniformSampler
- (void)updateUniforms

Discussion

And it will bind “kCCUniformSampler” to 0

Declared In

CCGLProgram.h

use

it will call glUseProgram()

- (void)use

Declared In

CCGLProgram.h

vertexShaderLog

returns the vertexShader error log

- (NSString *)vertexShaderLog

Declared In

CCGLProgram.h