cocos2d-x  3.5
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
GLProgram Class Reference

GLProgram Class that implements a glProgram. More...

#include <CCGLProgram.h>

Inheritance diagram for GLProgram:
Ref

Classes

struct  flag_struct
 

Public Types

enum  {
  VERTEX_ATTRIB_POSITION, VERTEX_ATTRIB_COLOR, VERTEX_ATTRIB_TEX_COORD, VERTEX_ATTRIB_TEX_COORD1,
  VERTEX_ATTRIB_TEX_COORD2, VERTEX_ATTRIB_TEX_COORD3, VERTEX_ATTRIB_NORMAL, VERTEX_ATTRIB_BLEND_WEIGHT,
  VERTEX_ATTRIB_BLEND_INDEX, VERTEX_ATTRIB_MAX, VERTEX_ATTRIB_TEX_COORDS = VERTEX_ATTRIB_TEX_COORD
}
 Enum the preallocated vertex attribute. More...
 
enum  {
  UNIFORM_AMBIENT_COLOR, UNIFORM_P_MATRIX, UNIFORM_MV_MATRIX, UNIFORM_MVP_MATRIX,
  UNIFORM_NORMAL_MATRIX, UNIFORM_TIME, UNIFORM_SIN_TIME, UNIFORM_COS_TIME,
  UNIFORM_RANDOM01, UNIFORM_SAMPLER0, UNIFORM_SAMPLER1, UNIFORM_SAMPLER2,
  UNIFORM_SAMPLER3, UNIFORM_MAX
}
 Preallocated uniform handle. More...
 

Public Member Functions

 GLProgram ()
 Constructor. More...
 
virtual ~GLProgram ()
 Destructor. More...
 
void bindAttribLocation (const std::string &attributeName, GLuint index) const
 It will add a new attribute to the shader by calling glBindAttribLocation. More...
 
GLint getAttribLocation (const std::string &attributeName) const
 Calls glGetAttribLocation. More...
 
GLint getUniformLocation (const std::string &attributeName) const
 Calls glGetUniformLocation(). More...
 
bool link ()
 links the glProgram More...
 
void use ()
 it will call glUseProgram() More...
 
void updateUniforms ()
 It will create 4 uniforms: More...
 
GLint getUniformLocationForName (const char *name) const
 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...
 
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...
 
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...
 
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...
 
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...
 
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 setUniformLocationWith1fv (GLint location, const GLfloat *floats, unsigned int numberOfArrays)
 calls glUniformfv only if the values are different than the previous call for this same shader program. More...
 
void setUniformLocationWith2fv (GLint location, const 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, const 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, const GLfloat *floats, unsigned int numberOfArrays)
 calls glUniform4fv only if the values are different than the previous call for this same shader program. More...
 
void setUniformLocationWithMatrix2fv (GLint location, const GLfloat *matrixArray, unsigned int numberOfMatrices)
 calls glUniformMatrix2fv only if the values are different than the previous call for this same shader program. More...
 
void setUniformLocationWithMatrix3fv (GLint location, const GLfloat *matrixArray, unsigned int numberOfMatrices)
 calls glUniformMatrix3fv only if the values are different than the previous call for this same shader program. More...
 
void setUniformLocationWithMatrix4fv (GLint location, const GLfloat *matrixArray, unsigned int numberOfMatrices)
 calls glUniformMatrix4fv only if the values are different than the previous call for this same shader program. More...
 
UniformgetUniform (const std::string &name)
VertexAttribgetVertexAttrib (const std::string &name)
- Public Member Functions inherited from Ref
void retain ()
 Retains the ownership. More...
 
void release ()
 Releases the ownership immediately. More...
 
Refautorelease ()
 Releases the ownership sometime soon automatically. More...
 
unsigned int getReferenceCount () const
 Returns the Ref's current reference count. More...
 
virtual ~Ref ()
 Destructor. More...
 

Static Public Attributes

static const char * UNIFORM_NAME_ALPHA_TEST_VALUE
 Alpha test value uniform. More...
 
static const char * ATTRIBUTE_NAME_NORMAL
 Attribute normal. More...
 
static const char * ATTRIBUTE_NAME_BLEND_WEIGHT
 Attribute blend weight. More...
 
static const char * ATTRIBUTE_NAME_BLEND_INDEX
 Attribute blend index. More...
 
Built Shader types
static const char * SHADER_NAME_POSITION_TEXTURE_COLOR
 Built in shader for 2d. More...
 
static const char * SHADER_NAME_POSITION_TEXTURE_COLOR_NO_MVP
 Built in shader for 2d. More...
 
static const char * SHADER_NAME_POSITION_TEXTURE_ALPHA_TEST
 Built in shader for 2d. More...
 
static const char * SHADER_NAME_POSITION_TEXTURE_ALPHA_TEST_NO_MV
 Built in shader for 2d. More...
 
static const char * SHADER_NAME_POSITION_COLOR
 Built in shader for 2d. More...
 
static const char * SHADER_NAME_POSITION_COLOR_TEXASPOINTSIZE
 Built in shader for 2d. More...
 
static const char * SHADER_NAME_POSITION_COLOR_NO_MVP
 Built in shader for 2d. More...
 
static const char * SHADER_NAME_POSITION_COLOR_NO_MVP_GRAYåSCALE
 Built in shader for 2d. More...
 
static const char * SHADER_NAME_POSITION_TEXTURE
 Built in shader for 2d. More...
 
static const char * SHADER_NAME_POSITION_TEXTURE_U_COLOR
 Built in shader for 2d. More...
 
static const char * SHADER_NAME_POSITION_TEXTURE_A8_COLOR
 Built in shader for 2d. More...
 
static const char * SHADER_NAME_POSITION_U_COLOR
 Built in shader for 2d. More...
 
static const char * SHADER_NAME_POSITION_LENGTH_TEXTURE_COLOR
 Built in shader for draw a sector with 90 degrees with center at bottom left point. More...
 
static const char * SHADER_NAME_LABEL_NORMAL
static const char * SHADER_NAME_LABEL_OUTLINE
static const char * SHADER_NAME_LABEL_DISTANCEFIELD_NORMAL
static const char * SHADER_NAME_LABEL_DISTANCEFIELD_GLOW
static const char * SHADER_3D_POSITION
 Built in shader used for 3D, support Position vertex attribute, with color specified by a uniform. More...
 
static const char * SHADER_3D_POSITION_TEXTURE
 Built in shader used for 3D, support Position and Texture vertex attribute, with color specified by a uniform. More...
 
static const char * SHADER_3D_SKINPOSITION_TEXTURE
 Built in shader used for 3D, support Position (Skeletal animation by hardware skin) and Texture vertex attribute, with color specified by a uniform. More...
 
static const char * SHADER_3D_POSITION_NORMAL
 Built in shader used for 3D, support Position and Normal vertex attribute, used in lighting. More...
 
static const char * SHADER_3D_POSITION_NORMAL_TEXTURE
 Built in shader used for 3D, support Position, Normal, Texture vertex attribute, used in lighting. More...
 
static const char * SHADER_3D_SKINPOSITION_NORMAL_TEXTURE
 Built in shader used for 3D, support Position(skeletal animation by hardware skin), Normal, Texture vertex attribute, used in lighting. More...
 
static const char * SHADER_3D_PARTICLE_TEXTURE
 Built in shader for particles, support Position and Texture, with a color specified by a uniform. More...
 
static const char * SHADER_3D_PARTICLE_COLOR
 Built in shader for particles, support Position, with a color specified by a uniform. More...
 
Built uniform names
static const char * UNIFORM_NAME_AMBIENT_COLOR
 Ambient Color uniform. More...
 
static const char * UNIFORM_NAME_P_MATRIX
 Projection Matrix uniform. More...
 
static const char * UNIFORM_NAME_MV_MATRIX
 Model view matrix uniform. More...
 
static const char * UNIFORM_NAME_MVP_MATRIX
 Model view projection uniform. More...
 
static const char * UNIFORM_NAME_NORMAL_MATRIX
 Normal matrix uniform. More...
 
static const char * UNIFORM_NAME_TIME
 Time uniform. More...
 
static const char * UNIFORM_NAME_SIN_TIME
 Sin time uniform. More...
 
static const char * UNIFORM_NAME_COS_TIME
 Cos time uniform. More...
 
static const char * UNIFORM_NAME_RANDOM01
 Random number uniform. More...
 
static const char * UNIFORM_NAME_SAMPLER0
 Sampler uniform 0-3, used for textures. More...
 
static const char * UNIFORM_NAME_SAMPLER1
static const char * UNIFORM_NAME_SAMPLER2
static const char * UNIFORM_NAME_SAMPLER3
Built Attribute names
static const char * ATTRIBUTE_NAME_COLOR
 Attribute color. More...
 
static const char * ATTRIBUTE_NAME_POSITION
 Attribute position. More...
 
static const char * ATTRIBUTE_NAME_TEX_COORD
static const char * ATTRIBUTE_NAME_TEX_COORD1
static const char * ATTRIBUTE_NAME_TEX_COORD2
static const char * ATTRIBUTE_NAME_TEX_COORD3

Friends

class GLProgramState
bool initWithPrecompiledProgramByteArray (const GLchar *vShaderByteArray, const GLchar *fShaderByteArray)
static GLProgramcreateWithPrecompiledProgramByteArray (const GLchar *vShaderByteArray, const GLchar *fShaderByteArray)
bool initWithByteArrays (const GLchar *vShaderByteArray, const GLchar *fShaderByteArray)
static GLProgramcreateWithByteArrays (const GLchar *vShaderByteArray, const GLchar *fShaderByteArray)
bool initWithFilenames (const std::string &vShaderFilename, const std::string &fShaderFilename)
static GLProgramcreateWithFilenames (const std::string &vShaderFilename, const std::string &fShaderFilename)
GLuint _program
 OpenGL handle for program. More...
 
GLuint _vertShader
 OpenGL handle for vertex shader. More...
 
GLuint _fragShader
 OpenGL handle for fragment shader. More...
 
GLint _builtInUniforms [UNIFORM_MAX]
 Built in uniforms. More...
 
bool _hasShaderCompiler
 Indicate whether it has a offline shader compiler or not. More...
 
std::string _shaderId
 Shader ID in precompiled shaders on Windows phone. More...
 
struct
cocos2d::GLProgram::flag_struct 
_flags
std::unordered_map
< std::string, Uniform
_userUniforms
 User defined Uniforms. More...
 
std::unordered_map
< std::string, VertexAttrib
_vertexAttribs
 User defined vertex attributes. More...
 
std::unordered_map< GLint,
std::pair< GLvoid *, unsigned
int > > 
_hashForUniforms
 Hash value of uniforms for quick access. More...
 
Director_director
void setUniformsForBuiltins ()
void setUniformsForBuiltins (const Mat4 &modelView)
std::string getVertexShaderLog () const
 @] More...
 
std::string getFragmentShaderLog () const
 returns the fragmentShader error log More...
 
std::string getProgramLog () const
 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...
 
const GLuint getProgram () const
bool initWithVertexShaderByteArray (const GLchar *vertexByteArray, const GLchar *fragByteArray)
bool initWithVertexShaderFilename (const std::string &vertexFilename, const std::string &fragFilename)
void addAttribute (const std::string &attributeName, GLuint index) const
bool updateUniformLocation (GLint location, const GLvoid *data, unsigned int bytes)
 Update the uniform data in location. More...
 
virtual std::string getDescription () const
 Get a general description of the shader. More...
 
void bindPredefinedVertexAttribs ()
 Bind the predefined vertex attributes to their specific slot. More...
 
void parseVertexAttribs ()
 Parse user defined Vertex Attributes automatically. More...
 
void parseUniforms ()
 Parse user defined uniform automatically. More...
 
bool compileShader (GLuint *shader, GLenum type, const GLchar *source)
 Compile the shader sources. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Ref
 Ref ()
 Constructor. More...
 
- Protected Attributes inherited from Ref
unsigned int _referenceCount
 count of references More...
 

Detailed Description

GLProgram Class that implements a glProgram.

Since
v2.0.0

Member Enumeration Documentation

anonymous enum

Enum the preallocated vertex attribute.

Enumerator
VERTEX_ATTRIB_POSITION 

Index 0 will be used as Position.

VERTEX_ATTRIB_COLOR 

Index 1 will be used as Color.

VERTEX_ATTRIB_TEX_COORD 

Index 2 will be used as Tex coord unit 0.

VERTEX_ATTRIB_TEX_COORD1 

Index 3 will be used as Tex coord unit 1.

VERTEX_ATTRIB_TEX_COORD2 

Index 4 will be used as Tex coord unit 2.

VERTEX_ATTRIB_TEX_COORD3 

Index 5 will be used as Tex coord unit 3.

VERTEX_ATTRIB_NORMAL 

Index 6 will be used as Normal.

VERTEX_ATTRIB_BLEND_WEIGHT 

Index 7 will be used as Blend weight for hardware skin.

VERTEX_ATTRIB_BLEND_INDEX 

Index 8 will be used as Blend index.

VERTEX_ATTRIB_MAX 
VERTEX_ATTRIB_TEX_COORDS 
anonymous enum

Preallocated uniform handle.

Enumerator
UNIFORM_AMBIENT_COLOR 

Ambient color.

UNIFORM_P_MATRIX 

Projection matrix.

UNIFORM_MV_MATRIX 

Model view matrix.

UNIFORM_MVP_MATRIX 

Model view projection matrix.

UNIFORM_NORMAL_MATRIX 

Normal matrix.

UNIFORM_TIME 

Time.

UNIFORM_SIN_TIME 

sin(Time).

UNIFORM_COS_TIME 

cos(Time).

UNIFORM_RANDOM01 

Random number.

UNIFORM_SAMPLER0 

Sampler 0-3, used for texture.

UNIFORM_SAMPLER1 
UNIFORM_SAMPLER2 
UNIFORM_SAMPLER3 
UNIFORM_MAX 

Constructor & Destructor Documentation

GLProgram ( )

Constructor.

virtual ~GLProgram ( )
virtual

Destructor.

Member Function Documentation

void addAttribute ( const std::string &  attributeName,
GLuint  index 
) const
inline
void bindAttribLocation ( const std::string &  attributeName,
GLuint  index 
) const

It will add a new attribute to the shader by calling glBindAttribLocation.

void bindPredefinedVertexAttribs ( )
protected

Bind the predefined vertex attributes to their specific slot.

bool compileShader ( GLuint *  shader,
GLenum  type,
const GLchar source 
)
protected

Compile the shader sources.

static GLProgram*
createWithByteArrays
( const GLchar vShaderByteArray,
const GLchar fShaderByteArray 
)
static

Create or Initializes the GLProgram with a vertex and fragment with bytes array.

static GLProgram*
createWithFilenames
( const std::string &  vShaderFilename,
const std::string &  fShaderFilename 
)
static

Create or Initializes the GLProgram with a vertex and fragment with contents of filenames.

static GLProgram*
createWithPrecompiledProgramByteArray
( const GLchar vShaderByteArray,
const GLchar fShaderByteArray 
)
static

Initializes the CCGLProgram with precompiled shader program.

GLint getAttribLocation ( const std::string &  attributeName) const

Calls glGetAttribLocation.

virtual std::string getDescription ( ) const
protectedvirtual

Get a general description of the shader.

std::string getFragmentShaderLog ( ) const

returns the fragmentShader error log

const GLuint getProgram ( ) const
inline
std::string getProgramLog ( ) const

returns the program error log

Uniform* getUniform ( const std::string &  name)

Get the uniform or vertex attribute by string name in shader, return null if it does not exist.

GLint getUniformLocation ( const std::string &  attributeName) const

Calls glGetUniformLocation().

GLint getUniformLocationForName ( const char *  name) const

calls retrieves the named uniform location for this shader program.

VertexAttrib* getVertexAttrib ( const std::string &  name)
std::string getVertexShaderLog ( ) const

@]

returns the vertexShader error log

bool initWithByteArrays ( const GLchar vShaderByteArray,
const GLchar fShaderByteArray 
)
bool initWithFilenames ( const std::string &  vShaderFilename,
const std::string &  fShaderFilename 
)
bool
initWithPrecompiledProgramByteArray
( const GLchar vShaderByteArray,
const GLchar fShaderByteArray 
)
bool initWithVertexShaderByteArray ( const GLchar vertexByteArray,
const GLchar fragByteArray 
)
inline
bool initWithVertexShaderFilename ( const std::string &  vertexFilename,
const std::string &  fragFilename 
)
inline
bool link ( )

links the glProgram

void parseUniforms ( )
protected

Parse user defined uniform automatically.

void parseVertexAttribs ( )
protected

Parse user defined Vertex Attributes automatically.

void 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.

In js or lua,please use setUniformLocationF32

void setUniformLocationWith1fv ( GLint  location,
const GLfloat *  floats,
unsigned int  numberOfArrays 
)

calls glUniformfv 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.

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.

In js or lua,please use setUniformLocationF32

void setUniformLocationWith2fv ( GLint  location,
const 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.

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.

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.

In js or lua,please use setUniformLocationF32

void setUniformLocationWith3fv ( GLint  location,
const 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.

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.

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.

In js or lua,please use setUniformLocationF32

void setUniformLocationWith4fv ( GLint  location,
const 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.

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.

void
setUniformLocationWithMatrix2fv
( GLint  location,
const GLfloat *  matrixArray,
unsigned int  numberOfMatrices 
)

calls glUniformMatrix2fv only if the values are different than the previous call for this same shader program.

void
setUniformLocationWithMatrix3fv
( GLint  location,
const GLfloat *  matrixArray,
unsigned int  numberOfMatrices 
)

calls glUniformMatrix3fv only if the values are different than the previous call for this same shader program.

void
setUniformLocationWithMatrix4fv
( GLint  location,
const 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.

Parameters
modelViewmodelView matrix applied to the built in uniform of the shader.
void setUniformsForBuiltins ( const Mat4 modelView)
bool updateUniformLocation ( GLint  location,
const GLvoid *  data,
unsigned int  bytes 
)
protected

Update the uniform data in location.

Parameters
locationThe location of the uniform.
dataUpdated data. bytes Data length in bytes to update.
void updateUniforms ( )

It will create 4 uniforms:

  • kUniformPMatrix
  • kUniformMVMatrix
  • kUniformMVPMatrix
  • GLProgram::UNIFORM_SAMPLER

And it will bind "GLProgram::UNIFORM_SAMPLER" to 0

void use ( )

it will call glUseProgram()

Friends And Related Function Documentation

friend class GLProgramState
friend

Member Data Documentation

GLint _builtInUniforms[UNIFORM_MAX]
protected

Built in uniforms.

Director* _director
protected
struct
cocos2d::GLProgram::flag_struct
_flags
protected
GLuint _fragShader
protected

OpenGL handle for fragment shader.

std::unordered_map<GLint,
std::pair<GLvoid*, unsigned
int> > _hashForUniforms
protected

Hash value of uniforms for quick access.

bool _hasShaderCompiler
protected

Indicate whether it has a offline shader compiler or not.

GLuint _program
protected

OpenGL handle for program.

std::string _shaderId
protected

Shader ID in precompiled shaders on Windows phone.

std::unordered_map<std::string,
Uniform> _userUniforms
protected

User defined Uniforms.

std::unordered_map<std::string,
VertexAttrib> _vertexAttribs
protected

User defined vertex attributes.

GLuint _vertShader
protected

OpenGL handle for vertex shader.

const char*
ATTRIBUTE_NAME_BLEND_INDEX
static

Attribute blend index.

const char*
ATTRIBUTE_NAME_BLEND_WEIGHT
static

Attribute blend weight.

const char* ATTRIBUTE_NAME_COLOR
static

Attribute color.

const char* ATTRIBUTE_NAME_NORMAL
static

Attribute normal.

const char* ATTRIBUTE_NAME_POSITION
static

Attribute position.

const char*
ATTRIBUTE_NAME_TEX_COORD
static

Attribute Texcoord 0-3.

const char*
ATTRIBUTE_NAME_TEX_COORD1
static
const char*
ATTRIBUTE_NAME_TEX_COORD2
static
const char*
ATTRIBUTE_NAME_TEX_COORD3
static
const char*
SHADER_3D_PARTICLE_COLOR
static

Built in shader for particles, support Position, with a color specified by a uniform.

const char*
SHADER_3D_PARTICLE_TEXTURE
static

Built in shader for particles, support Position and Texture, with a color specified by a uniform.

const char* SHADER_3D_POSITION
static

Built in shader used for 3D, support Position vertex attribute, with color specified by a uniform.

const char*
SHADER_3D_POSITION_NORMAL
static

Built in shader used for 3D, support Position and Normal vertex attribute, used in lighting.

with color specified by a uniform.

const char*
SHADER_3D_POSITION_NORMAL_TEXTURE
static

Built in shader used for 3D, support Position, Normal, Texture vertex attribute, used in lighting.

with color specified by a uniform.

const char*
SHADER_3D_POSITION_TEXTURE
static

Built in shader used for 3D, support Position and Texture vertex attribute, with color specified by a uniform.

const char*
SHADER_3D_SKINPOSITION_NORMAL_TEXTURE
static

Built in shader used for 3D, support Position(skeletal animation by hardware skin), Normal, Texture vertex attribute, used in lighting.

with color specified by a uniform.

const char*
SHADER_3D_SKINPOSITION_TEXTURE
static

Built in shader used for 3D, support Position (Skeletal animation by hardware skin) and Texture vertex attribute, with color specified by a uniform.

const char*
SHADER_NAME_LABEL_DISTANCEFIELD_GLOW
static
const char*
SHADER_NAME_LABEL_DISTANCEFIELD_NORMAL
static
const char*
SHADER_NAME_LABEL_NORMAL
static

Built in shader for label and label with effects.

const char*
SHADER_NAME_LABEL_OUTLINE
static
const char*
SHADER_NAME_POSITION_COLOR
static

Built in shader for 2d.

Support Position, Color vertex attribute.

const char*
SHADER_NAME_POSITION_COLOR_NO_MVP
static

Built in shader for 2d.

Support Position, Color vertex attribute, without multiply vertex by MVP matrix.

const char*
SHADER_NAME_POSITION_COLOR_NO_MVP_GRAYåSCALE
static

Built in shader for 2d.

Support Position, Color vertex attribute, without multiply vertex by MVP matrix and have a grey scale fragment shader.

const char*
SHADER_NAME_POSITION_COLOR_TEXASPOINTSIZE
static

Built in shader for 2d.

Support Position, Color, Texture vertex attribute. texture coordinate will used as point size.

const char*
SHADER_NAME_POSITION_LENGTH_TEXTURE_COLOR
static

Built in shader for draw a sector with 90 degrees with center at bottom left point.

const char*
SHADER_NAME_POSITION_TEXTURE
static

Built in shader for 2d.

Support Position, Texture vertex attribute.

const char*
SHADER_NAME_POSITION_TEXTURE_A8_COLOR
static

Built in shader for 2d.

Support Position, Texture and Color vertex attribute. but alpha will be the multiplication of color attribute and texture.

const char*
SHADER_NAME_POSITION_TEXTURE_ALPHA_TEST
static

Built in shader for 2d.

Support Position, Texture vertex attribute, but include alpha test.

const char*
SHADER_NAME_POSITION_TEXTURE_ALPHA_TEST_NO_MV
static

Built in shader for 2d.

Support Position, Texture and Color vertex attribute, include alpha test and without multiply vertex by MVP matrix.

const char*
SHADER_NAME_POSITION_TEXTURE_COLOR
static

Built in shader for 2d.

Support Position, Texture and Color vertex attribute.

const char*
SHADER_NAME_POSITION_TEXTURE_COLOR_NO_MVP
static

Built in shader for 2d.

Support Position, Texture and Color vertex attribute, but without multiply vertex by MVP matrix.

const char*
SHADER_NAME_POSITION_TEXTURE_U_COLOR
static

Built in shader for 2d.

Support Position, Texture vertex attribute. with a specified uniform as color

const char*
SHADER_NAME_POSITION_U_COLOR
static

Built in shader for 2d.

Support Position, with color specified by a uniform.

const char*
UNIFORM_NAME_ALPHA_TEST_VALUE
static

Alpha test value uniform.

const char*
UNIFORM_NAME_AMBIENT_COLOR
static

Ambient Color uniform.

const char* UNIFORM_NAME_COS_TIME
static

Cos time uniform.

const char* UNIFORM_NAME_MV_MATRIX
static

Model view matrix uniform.

const char* UNIFORM_NAME_MVP_MATRIX
static

Model view projection uniform.

const char*
UNIFORM_NAME_NORMAL_MATRIX
static

Normal matrix uniform.

const char* UNIFORM_NAME_P_MATRIX
static

Projection Matrix uniform.

const char* UNIFORM_NAME_RANDOM01
static

Random number uniform.

const char* UNIFORM_NAME_SAMPLER0
static

Sampler uniform 0-3, used for textures.

const char* UNIFORM_NAME_SAMPLER1
static
const char* UNIFORM_NAME_SAMPLER2
static
const char* UNIFORM_NAME_SAMPLER3
static
const char* UNIFORM_NAME_SIN_TIME
static

Sin time uniform.

const char* UNIFORM_NAME_TIME
static

Time uniform.


The documentation for this class was generated from the following file: