#import <CC3GLSLVariable.h>
Properties | |
GLenum | type |
Properties inherited from CC3GLSLVariable | |
GLuint | index |
BOOL | isGLStateKnown |
GLint | location |
NSString * | name |
CC3ShaderProgram * | program |
CC3GLSLVariableScope | scope |
GLenum | semantic |
GLuint | semanticIndex |
GLint | size |
GLuint | storageElementCount |
GLenum | type |
GLuint | typeStorageElementCount |
Additional Inherited Members | |
Class Methods inherited from CC3GLSLVariable | |
(id) | + variableInProgram:atIndex: |
Represents a uniform variable used in a GLSL shader program.
The value of the uniform in the GL engine is tracked and is only set within the GL engine if the value has changed from its current value.
- (void) setBoolean: | (BOOL) | value |
Sets the value of this uniform to the specified value.
If this uniform has been declared as an array, this method sets the value of the first element in the array.
The type property of this instance can be any value other than one of matrix types. If the type property indicates a float type, the boolean is converted to a float. If the type property indicates a vector type with more than one component, the remaining components are set to zero.
- (void) setBoolean: | (BOOL) | value | |
at: | (GLuint) | index | |
Sets the element at the specified index in this uniform to the specified value.
The specified index must be less than the value of the size property. This method may still be used when this uniform has not been declared as an array. In this case, the value of the size property will be one, and so the specified index must be zero.
The type property of this instance can be any value other than one of matrix types. If the type property indicates a float type, the boolean is converted to a float. If the type property indicates a vector type with more than one component, the remaining components are set to zero.
- (void) setBooleanVectorX: | (BOOL) | bX | |
andY: | (BOOL) | bY | |
Sets the value of this boolean vector uniform to the specified value.
If this uniform has been declared as an array, this method sets the value of the first element in the array.
The type property of this instance can be any value other than one of matrix types. If the type property indicates a float type, the booleans are converted to floats. If the type property indicates a scalar, the X component is used. If the type property indicates a vector type with more than two components, the remaining components are set to zero.
- (void) setBooleanVectorX: | (BOOL) | bX | |
andY: | (BOOL) | bY | |
andZ: | (BOOL) | bZ | |
Sets the value of this boolean vector uniform to the specified value.
If this uniform has been declared as an array, this method sets the value of the first element in the array.
The type property of this instance can be any value other than one of matrix types. If the type property indicates a float type, the booleans are converted to floats. If the type property indicates a scalar, the X component is used. If the type property indicates a vector type with fewer than three components, the X & Y components will be used. If the type property indicates a vector type with more than three components, fourth component is set to zero.
- (void) setBooleanVectorX: | (BOOL) | bX | |
andY: | (BOOL) | bY | |
andZ: | (BOOL) | bZ | |
andW: | (BOOL) | bW | |
Sets the value of this boolean vector uniform to the specified value.
If this uniform has been declared as an array, this method sets the value of the first element in the array.
The type property of this instance can be any value other than one of matrix types. If the type property indicates a float type, the booleans are converted to floats. If the type property indicates a scalar, the X component is used. If the type property indicates a vector type with fewer than four components, the X & Y, or X, Y & Z components are used.
- (void) setBooleanVectorX: | (BOOL) | bX | |
andY: | (BOOL) | bY | |
andZ: | (BOOL) | bZ | |
andW: | (BOOL) | bW | |
at: | (GLuint) | index | |
Sets the element at the specified index of this boolean vector uniform to the specified value.
The specified index must be less than the value of the size property. This method may still be used when this uniform has not been declared as an array. In this case, the value of the size property will be one, and so the specified index must be zero.
The type property of this instance can be any value other than one of matrix types. If the type property indicates a float type, the booleans are converted to floats. If the type property indicates a scalar, the X component is used. If the type property indicates a vector type with fewer than four components, the X & Y, or X, Y & Z components are used.
- (void) setBooleanVectorX: | (BOOL) | bX | |
andY: | (BOOL) | bY | |
andZ: | (BOOL) | bZ | |
at: | (GLuint) | index | |
Sets the element at the specified index of this boolean vector uniform to the specified value.
The specified index must be less than the value of the size property. This method may still be used when this uniform has not been declared as an array. In this case, the value of the size property will be one, and so the specified index must be zero.
The type property of this instance can be any value other than one of matrix types. If the type property indicates a float type, the booleans are converted to floats. If the type property indicates a scalar, the X component is used. If the type property indicates a vector type with fewer than three components, the X & Y components will be used. If the type property indicates a vector type with more than three components, fourth component is set to zero.
- (void) setBooleanVectorX: | (BOOL) | bX | |
andY: | (BOOL) | bY | |
at: | (GLuint) | index | |
Sets the element at the specified index of this boolean vector uniform to the specified value.
The specified index must be less than the value of the size property. This method may still be used when this uniform has not been declared as an array. In this case, the value of the size property will be one, and so the specified index must be zero.
The type property of this instance can be any value other than one of matrix types. If the type property indicates a float type, the booleans are converted to floats. If the type property indicates a scalar, the X component is used. If the type property indicates a vector type with more than two components, the remaining components are set to zero.
- (void) setColor4B: | (ccColor4B) | value |
Sets the value of this uniform to the specified value.
If this uniform has been declared as an array, this method sets the value of the first element in the array.
The type property of this instance can be any value other than one of matrix types. If the type property indicates an float type, the integers are normalized to floats between 0 and 1. If the type property indicates a scalar, the R component of the specified color is used. If the type property indicates a vector type with fewer than four components, the R & G, or R, G & B components are used.
- (void) setColor4B: | (ccColor4B) | value | |
at: | (GLuint) | index | |
Sets the element at the specified index in this uniform to the specified value.
The specified index must be less than the value of the size property. This method may still be used when this uniform has not been declared as an array. In this case, the value of the size property will be one, and so the specified index must be zero.
The type property of this instance can be any value other than one of matrix types. If the type property indicates an float type, the integers are normalized to floats between 0 and 1. If the type property indicates a scalar, the R component of the specified color is used. If the type property indicates a vector type with fewer than four components, the R & G, or R, G & B components are used.
- (void) setColor4F: | (ccColor4F) | value |
Sets the value of this uniform to the specified value.
If this uniform has been declared as an array, this method sets the value of the first element in the array.
The type property of this instance can be any value other than one of matrix types. If the type property indicates an integer type, the floats are converted to integers in the range 0 to 255. If the type property indicates a scalar, the R component of the specified color is used. If the type property indicates a vector type with fewer than four components, the R & G, or R, G & B components are used.
- (void) setColor4F: | (ccColor4F) | value | |
at: | (GLuint) | index | |
Sets the element at the specified index in this uniform to the specified value.
The specified index must be less than the value of the size property. This method may still be used when this uniform has not been declared as an array. In this case, the value of the size property will be one, and so the specified index must be zero.
The type property of this instance can be any value other than one of matrix types. If the type property indicates an integer type, the floats are converted to integers in the range 0 to 255. If the type property indicates a scalar, the R component of the specified color is used. If the type property indicates a vector type with fewer than four components, the R & G, or R, G & B components are used.
- (void) setFloat: | (GLfloat) | value |
Sets the value of this uniform to the specified value.
If this uniform has been declared as an array, this method sets the value of the first element in the array.
The type property of this instance can be any value other than one of matrix types. If the type property indicates an integer type, the float is converted to an integer. If the type property indicates a vector type with more than one component, the second and third components are set to zero and the fourth component is set to one.
- (void) setFloat: | (GLfloat) | value | |
at: | (GLuint) | index | |
Sets the element at the specified index in this uniform to the specified value.
The specified index must be less than the value of the size property. This method may still be used when this uniform has not been declared as an array. In this case, the value of the size property will be one, and so the specified index must be zero.
The type property of this instance can be any value other than one of matrix types. If the type property indicates an integer type, the float is converted to an integer. If the type property indicates a vector type with more than one component, the second and third components are set to zero and the fourth component is set to one.
- (void) setInteger: | (GLint) | value |
Sets the value of this uniform to the specified value.
If this uniform has been declared as an array, this method sets the value of the first element in the array.
The type property of this instance can be any value other than one of matrix types. If the type property indicates a float type, the integer is converted to a float. If the type property indicates a vector type with more than one component, the remaining components are set to zero.
- (void) setInteger: | (GLint) | value | |
at: | (GLuint) | index | |
Sets the element at the specified index in this uniform to the specified value.
The specified index must be less than the value of the size property. This method may still be used when this uniform has not been declared as an array. In this case, the value of the size property will be one, and so the specified index must be zero.
The type property of this instance can be any value other than one of matrix types. If the type property indicates a float type, the integer is converted to a float. If the type property indicates a vector type with more than one component, the remaining components are set to zero.
- (void) setIntPoint: | (CC3IntPoint) | value |
Sets the value of this uniform to the specified value.
If this uniform has been declared as an array, this method sets the value of the first element in the array.
The type property of this instance can be any value other than one of matrix types. If the type property indicates a float type, the integer is converted to a float. If the type property indicates a scalar, the X component of the specified point is used. If the type property indicates a vector type with more than two components, the remaining components are set to zero.
- (void) setIntPoint: | (CC3IntPoint) | value | |
at: | (GLuint) | index | |
Sets the element at the specified index in this uniform to the specified value.
The specified index must be less than the value of the size property. This method may still be used when this uniform has not been declared as an array. In this case, the value of the size property will be one, and so the specified index must be zero.
The type property of this instance can be any value other than one of matrix types. If the type property indicates a float type, the integers are converted to floats. If the type property indicates a scalar, the X component of the specified point is used. If the type property indicates a vector type with more than two components, the remaining components are set to zero.
- (void) setIntVector4: | (CC3IntVector4) | value |
Sets the value of this uniform to the specified value.
If this uniform has been declared as an array, this method sets the value of the first element in the array.
The type property of this instance can be any value other than one of matrix types. If the type property indicates a float type, the integers are converted to floats. If the type property indicates a scalar, the X component of the specified vector is used. If the type property indicates a vector type with fewer than four components, the X & Y, or X, Y & Z components are used.
- (void) setIntVector4: | (CC3IntVector4) | value | |
at: | (GLuint) | index | |
Sets the element at the specified index in this uniform to the specified value.
The specified index must be less than the value of the size property. This method may still be used when this uniform has not been declared as an array. In this case, the value of the size property will be one, and so the specified index must be zero.
The type property of this instance can be any value other than one of matrix types. If the type property indicates a float type, the integers are converted to floats. If the type property indicates a scalar, the X component of the specified vector is used. If the type property indicates a vector type with fewer than four components, the X & Y, or X, Y & Z components are used.
- (void) setIntVector: | (CC3IntVector) | value |
Sets the value of this uniform to the specified value.
If this uniform has been declared as an array, this method sets the value of the first element in the array.
The type property of this instance can be any value other than one of matrix types. If the type property indicates a float type, the integers are converted to floats. If the type property indicates a scalar, the X component of the specified vector is used. If the type property indicates a vector type with fewer than three components, the X & Y components will be used. If the type property indicates a vector type with more than three components, the fourth component is set to zero.
- (void) setIntVector: | (CC3IntVector) | value | |
at: | (GLuint) | index | |
Sets the element at the specified index in this uniform to the specified value.
The specified index must be less than the value of the size property. This method may still be used when this uniform has not been declared as an array. In this case, the value of the size property will be one, and so the specified index must be zero.
The type property of this instance can be any value other than one of matrix types. If the type property indicates a float type, the integers are converted to floats. If the type property indicates a scalar, the X component of the specified vector is used. If the type property indicates a vector type with fewer than three components, the X & Y components will be used. If the type property indicates a vector type with more than three components, fourth component is set to zero.
- (void) setMatrix3x3: | (const CC3Matrix3x3 *) | value |
Sets the value of this uniform to the specified value.
If this uniform has been declared as an array, this method sets the value of the first element in the array.
The type property of this instance must be GL_FLOAT_MAT3.
- (void) setMatrix3x3: | (const CC3Matrix3x3 *) | value | |
at: | (GLuint) | index | |
Sets the element at the specified index in this uniform to the specified value.
The specified index must be less than the value of the size property. This method may still be used when this uniform has not been declared as an array. In this case, the value of the size property will be one, and so the specified index must be zero.
The type property of this instance must be GL_FLOAT_MAT3.
- (void) setMatrix4x3: | (const CC3Matrix4x3 *) | value |
Sets the 4x4 value of this uniform from the specified 4x3 value, adding the last identity row.
If this uniform has been declared as an array, this method sets the value of the first element in the array.
The type property of this instance must be GL_FLOAT_MAT4.
- (void) setMatrix4x3: | (const CC3Matrix4x3 *) | value | |
at: | (GLuint) | index | |
Sets the 4x4 element at the specified index in this uniform to the specified 4x3 value, adding the last identity row.
The specified index must be less than the value of the size property. This method may still be used when this uniform has not been declared as an array. In this case, the value of the size property will be one, and so the specified index must be zero.
The type property of this instance must be GL_FLOAT_MAT4.
- (void) setMatrix4x4: | (const CC3Matrix4x4 *) | value |
Sets the value of this uniform to the specified value.
If this uniform has been declared as an array, this method sets the value of the first element in the array.
The type property of this instance must be GL_FLOAT_MAT4.
- (void) setMatrix4x4: | (const CC3Matrix4x4 *) | value | |
at: | (GLuint) | index | |
Sets the element at the specified index in this uniform to the specified value.
The specified index must be less than the value of the size property. This method may still be used when this uniform has not been declared as an array. In this case, the value of the size property will be one, and so the specified index must be zero.
The type property of this instance must be GL_FLOAT_MAT4.
- (void) setPoint: | (CGPoint) | value |
Sets the value of this uniform to the specified value.
If this uniform has been declared as an array, this method sets the value of the first element in the array.
The type property of this instance can be any value other than one of matrix types. If the type property indicates an integer type, the floats are converted to integers. If the type property indicates a scalar, the X component of the specified point is used. If the type property indicates a vector type with more than two components, the third component is set to zero and the fourth component is set to one.
- (void) setPoint: | (CGPoint) | value | |
at: | (GLuint) | index | |
Sets the element at the specified index in this uniform to the specified value.
The specified index must be less than the value of the size property. This method may still be used when this uniform has not been declared as an array. In this case, the value of the size property will be one, and so the specified index must be zero.
The type property of this instance can be any value other than one of matrix types. If the type property indicates an integer type, the floats are converted to integers. If the type property indicates a scalar, the X component of the specified point is used. If the type property indicates a vector type with more than two components, the third component is set to zero and the fourth component is set to one.
- (void) setQuaternion: | (CC3Quaternion) | value |
Sets the value of this uniform to the specified value.
If this uniform has been declared as an array, this method sets the value of the first element in the array.
The type property of this instance can be any value other than one of matrix types. If the type property indicates an integer type, the floats are converted to integers. If the type property indicates a scalar, the X component of the specified vector is used. If the type property indicates a vector type with fewer than four components, the X & Y, or X, Y & Z components are used.
- (void) setQuaternion: | (CC3Quaternion) | value | |
at: | (GLuint) | index | |
Sets the element at the specified index in this uniform to the specified value.
The specified index must be less than the value of the size property. This method may still be used when this uniform has not been declared as an array. In this case, the value of the size property will be one, and so the specified index must be zero.
The type property of this instance can be any value other than one of matrix types. If the type property indicates an integer type, the floats are converted to integers. If the type property indicates a scalar, the X component of the specified vector is used. If the type property indicates a vector type with fewer than four components, the X & Y, or X, Y & Z components are used.
- (void) setValueFromUniform: | (CC3GLSLUniform *) | uniform |
Sets the value of this uniform from the value of the specified uniform.
- (void) setVector4: | (CC3Vector4) | value |
Sets the value of this uniform to the specified value.
If this uniform has been declared as an array, this method sets the value of the first element in the array.
The type property of this instance can be any value other than one of matrix types. If the type property indicates an integer type, the floats are converted to integers. If the type property indicates a scalar, the X component of the specified vector is used. If the type property indicates a vector type with fewer than four components, the X & Y, or X, Y & Z components are used.
- (void) setVector4: | (CC3Vector4) | value | |
at: | (GLuint) | index | |
Sets the element at the specified index in this uniform to the specified value.
The specified index must be less than the value of the size property. This method may still be used when this uniform has not been declared as an array. In this case, the value of the size property will be one, and so the specified index must be zero.
The type property of this instance can be any value other than one of matrix types. If the type property indicates an integer type, the floats are converted to integers. If the type property indicates a scalar, the X component of the specified vector is used. If the type property indicates a vector type with fewer than four components, the X & Y, or X, Y & Z components are used.
- (void) setVector: | (CC3Vector) | value |
Sets the value of this uniform to the specified value.
If this uniform has been declared as an array, this method sets the value of the first element in the array.
The type property of this instance can be any value other than one of matrix types. If the type property indicates an integer type, the floats are converted to integers. If the type property indicates a scalar, the X component of the specified vector is used. If the type property indicates a vector type with fewer than three components, the X & Y components will be used. If the type property indicates a vector type with more than three components, fourth component is set to one.
- (void) setVector: | (CC3Vector) | value | |
at: | (GLuint) | index | |
Sets the element at the specified index in this uniform to the specified value.
The specified index must be less than the value of the size property. This method may still be used when this uniform has not been declared as an array. In this case, the value of the size property will be one, and so the specified index must be zero.
The type property of this instance can be any value other than one of matrix types. If the type property indicates an integer type, the floats are converted to integers. If the type property indicates a scalar, the X component of the specified vector is used. If the type property indicates a vector type with fewer than three components, the X & Y components will be used. If the type property indicates a vector type with more than three components, fourth component is set to one.
- (BOOL) updateGLValueWithVisitor: | (CC3NodeDrawingVisitor *) | visitor |
Invoked during drawing, after all of the content of the variable has been set using the set...
methods, in order to have the value of this variable set into the GL engine.
The GL engine is only updated if the content of this variable has changed. Returns whether the value has changed and was updated into the GL engine.
This method is invoked automatically during uniform population. The application normally never needs to invoke this method.
- (NSString*) valueDescription |
Returns a string description of the current value of this uniform.
|
readnonatomicassign |
Returns a symbolic constant indicating the type of content held by this variable.
The returned value will be one of the following symbolic constants: