Cocos2d-x  v3.10
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups
UniformValue Class Reference

Uniform Value, which is used to store to value send to openGL pipe line by glUniformXXX. More...

Public Member Functions

 UniformValue ()
 Constructor. More...
 
 UniformValue (Uniform *uniform, GLProgram *glprogram)
 Constructor with uniform and glprogram. More...
 
 ~UniformValue ()
 Destructor.
 
void setFloat (float value)
 Set Uniform value. More...
 
void setInt (int value)
 Set Uniform value. More...
 
void setFloatv (ssize_t size, const float *pointer)
 Set Uniform value. More...
 
void setVec2 (const Vec2 &value)
 Set Uniform value. More...
 
void setVec2v (ssize_t size, const Vec2 *pointer)
 Set Uniform value. More...
 
void setVec3 (const Vec3 &value)
 Set Uniform value. More...
 
void setVec3v (ssize_t size, const Vec3 *pointer)
 Set Uniform value. More...
 
void setVec4 (const Vec4 &value)
 Set Uniform value. More...
 
void setVec4v (ssize_t size, const Vec4 *pointer)
 Set Uniform value. More...
 
void setMat4 (const Mat4 &value)
 Set Uniform value. More...
 
void setCallback (const std::function< void(GLProgram *, Uniform *)> &callback)
 Set call back to uniform value, which could be used for array and struct. More...
 
void setTexture (GLuint textureId, GLuint textureUnit)
 Set texture to uniform value. More...
 
void apply ()
 Apply the uniform value to openGL pipeline.
 

Detailed Description

Uniform Value, which is used to store to value send to openGL pipe line by glUniformXXX.

Constructor & Destructor Documentation

Constructor.

The Uniform and Glprogram will be nullptr.

var UniformValue ( )

Constructor.

The Uniform and Glprogram will be nullptr.

UniformValue ( Uniform uniform,
GLProgram glprogram 
)

Constructor with uniform and glprogram.

Uniform to apply the value. Specify the owner GLProgram of this uniform and uniform value.

var UniformValue ( var  uniform,
var  glprogram 
)

Constructor with uniform and glprogram.

Uniform to apply the value. Specify the owner GLProgram of this uniform and uniform value.

Member Function Documentation

void setFloat ( float  value)

Set Uniform value.

The float value

var setFloat ( var  value)

Set Uniform value.

The float value

void setInt ( int  value)

Set Uniform value.

The int value

var setInt ( var  value)

Set Uniform value.

The int value

void setFloatv ( ssize_t  size,
const float *  pointer 
)

Set Uniform value.

The number of float. The float value pointer

var setFloatv ( var  size,
var  pointer 
)

Set Uniform value.

The number of float. The float value pointer

void setVec2 ( const Vec2 value)

Set Uniform value.

The Vec2 value

var setVec2 ( var  value)

Set Uniform value.

The Vec2 value

void setVec2v ( ssize_t  size,
const Vec2 pointer 
)

Set Uniform value.

The number of Vec2. The Vec2 value pointer

var setVec2v ( var  size,
var  pointer 
)

Set Uniform value.

The number of Vec2. The Vec2 value pointer

void setVec3 ( const Vec3 value)

Set Uniform value.

The Vec2 value

var setVec3 ( var  value)

Set Uniform value.

The Vec2 value

void setVec3v ( ssize_t  size,
const Vec3 pointer 
)

Set Uniform value.

The number of Vec3. The Vec3 value pointer

var setVec3v ( var  size,
var  pointer 
)

Set Uniform value.

The number of Vec3. The Vec3 value pointer

void setVec4 ( const Vec4 value)

Set Uniform value.

The Vec2 value

var setVec4 ( var  value)

Set Uniform value.

The Vec2 value

void setVec4v ( ssize_t  size,
const Vec4 pointer 
)

Set Uniform value.

The number of Vec4. The Vec4 value pointer

var setVec4v ( var  size,
var  pointer 
)

Set Uniform value.

The number of Vec4. The Vec4 value pointer

void setMat4 ( const Mat4 value)

Set Uniform value.

The Mat4 value

var setMat4 ( var  value)

Set Uniform value.

The Mat4 value

void setCallback ( const std::function< void(GLProgram *, Uniform *)> &  callback)

Set call back to uniform value, which could be used for array and struct.

Callback function to send data to OpenGL pipeline.

var setCallback ( var  callback)

Set call back to uniform value, which could be used for array and struct.

Callback function to send data to OpenGL pipeline.

void setTexture ( GLuint  textureId,
GLuint  textureUnit 
)

Set texture to uniform value.

The texture handle. The binding texture unit to be used in shader.

var setTexture ( var  textureId,
var  textureUnit 
)

Set texture to uniform value.

The texture handle. The binding texture unit to be used in shader.


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