All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Luminous::ShaderUniform Struct Reference

A shader uniform. More...

#include <Luminous/ShaderUniform.hpp>

Public Types

enum  Type {
  Unknown, Int, Int2, Int3,
  Int4, UnsignedInt, UnsignedInt2, UnsignedInt3,
  UnsignedInt4, Float, Float2, Float3,
  Float4, Float2x2, Float3x3, Float4x4
}
 Type of this uniform. More...
 

Public Member Functions

virtual const char * data () const
 Returns the pointer to the stored data. More...
 
 ShaderUniform ()
 Default constructor Sets the Type of the uniform to Unknown.
 
 ShaderUniform (int data)
 Constructor for singed integer Sets Type of this uniform to Int. More...
 
 ShaderUniform (unsigned int data)
 Constructor for unsigned integer Sets Type of this uniform to UnsignedInt. More...
 
 ShaderUniform (float data)
 Constructor for floating point number Sets Type of this uniform to Float. More...
 
 ShaderUniform (const Nimble::Vector2i &data)
 Constructor for 2-dimensional signed integer vector Sets Type of this uniform to Int2. More...
 
 ShaderUniform (const Nimble::Vector3i &data)
 Constructor for 3-dimensional signed integer vector Sets Type of this uniform to Int3. More...
 
 ShaderUniform (const Nimble::Vector4i &data)
 Constructor for 4-dimensional signed integer vector Sets Type of this uniform to Int4. More...
 
 ShaderUniform (const Nimble::Vector2u &data)
 Constructor for 2-dimensional unsigned integer vector Sets Type of this uniform to UnsignedInt2. More...
 
 ShaderUniform (const Nimble::Vector3u &data)
 Constructor for 3-dimensional unsigned integer vector Sets Type of this uniform to UnsignedInt3. More...
 
 ShaderUniform (const Nimble::Vector4u &data)
 Constructor for 4-dimensional unsigned integer vector Sets Type of this uniform to UnsignedInt4. More...
 
 ShaderUniform (const Nimble::Vector2f &data)
 Constructor for 2-dimensional floating point vector Sets Type of this uniform to Float2. More...
 
 ShaderUniform (const Nimble::Vector3f &data)
 Constructor for 3-dimensional floating point vector Sets Type of this uniform to Float3. More...
 
 ShaderUniform (const Nimble::Vector4f &data)
 Constructor for 4-dimensional floating point vector Sets Type of this uniform to Float4. More...
 
 ShaderUniform (const Nimble::Matrix2f &data)
 Constructor for 2x2-dimensional matrix Sets Type of this uniform to Float2x2. More...
 
 ShaderUniform (const Nimble::Matrix3f &data)
 Constructor for 3x3-dimensional matrix Sets Type of this uniform to Float3x3. More...
 
 ShaderUniform (const Nimble::Matrix4f &data)
 Constructor for 4x4-dimensional matrix Sets Type of this uniform to Float4x4. More...
 
virtual Type type () const
 Returns the type of the stored data. More...
 

Detailed Description

A shader uniform.

Shader uniforms are used to pass uniform variables to OpenGL shaders.

Member Enumeration Documentation

Type of this uniform.

Enumerator
Unknown 

Unknown type, can't be applied to shader program.

Int 

Signed integer, GLSL-type "int".

Int2 

2-dimensional vector of signed integers, GLSL-type "ivec2"

Int3 

3-dimensional vector of signed integers, GLSL-type "ivec3"

Int4 

4-dimensional vector of signed integers, GLSL-type "ivec4"

UnsignedInt 

Unsigned integers, GLSL-type "uint".

UnsignedInt2 

2-dimensional vector of unsigned integers, GLSL-type "uvec2"

UnsignedInt3 

3-dimensional vector of unsigned integers, GLSL-type "uvec3"

UnsignedInt4 

4-dimensional vector of unsigned integers, GLSL-type "uvec4"

Float 

Floating point number, GLSL-type "float".

Float2 

2-dimensional vector of floats, GLSL-type "vec2"

Float3 

3-dimensional vector of floats, GLSL-type "vec3"

Float4 

4-dimensional vector of floats, GLSL-type "vec4"

Float2x2 

2x2-matrix of floats, GLSL-type "mat2"

Float3x3 

3x3-matrix of floats, GLSL-type "mat3"

Float4x4 

4x4-matrix of floats, GLSL-type "mat4"

Constructor & Destructor Documentation

Luminous::ShaderUniform::ShaderUniform ( int  data)
inline

Constructor for singed integer Sets Type of this uniform to Int.

Parameters
dataValue of the uniform
Luminous::ShaderUniform::ShaderUniform ( unsigned int  data)
inline

Constructor for unsigned integer Sets Type of this uniform to UnsignedInt.

Parameters
dataValue of the uniform
Luminous::ShaderUniform::ShaderUniform ( float  data)
inline

Constructor for floating point number Sets Type of this uniform to Float.

Parameters
dataValue of the uniform
Luminous::ShaderUniform::ShaderUniform ( const Nimble::Vector2i data)
inline

Constructor for 2-dimensional signed integer vector Sets Type of this uniform to Int2.

Parameters
dataValue of the uniform
Luminous::ShaderUniform::ShaderUniform ( const Nimble::Vector3i data)
inline

Constructor for 3-dimensional signed integer vector Sets Type of this uniform to Int3.

Parameters
dataValue of the uniform
Luminous::ShaderUniform::ShaderUniform ( const Nimble::Vector4i data)
inline

Constructor for 4-dimensional signed integer vector Sets Type of this uniform to Int4.

Parameters
dataValue of the uniform
Luminous::ShaderUniform::ShaderUniform ( const Nimble::Vector2u data)
inline

Constructor for 2-dimensional unsigned integer vector Sets Type of this uniform to UnsignedInt2.

Parameters
dataValue of the uniform
Luminous::ShaderUniform::ShaderUniform ( const Nimble::Vector3u data)
inline

Constructor for 3-dimensional unsigned integer vector Sets Type of this uniform to UnsignedInt3.

Parameters
dataValue of the uniform
Luminous::ShaderUniform::ShaderUniform ( const Nimble::Vector4u data)
inline

Constructor for 4-dimensional unsigned integer vector Sets Type of this uniform to UnsignedInt4.

Parameters
dataValue of the uniform
Luminous::ShaderUniform::ShaderUniform ( const Nimble::Vector2f data)
inline

Constructor for 2-dimensional floating point vector Sets Type of this uniform to Float2.

Parameters
dataValue of the uniform
Luminous::ShaderUniform::ShaderUniform ( const Nimble::Vector3f data)
inline

Constructor for 3-dimensional floating point vector Sets Type of this uniform to Float3.

Parameters
dataValue of the uniform
Luminous::ShaderUniform::ShaderUniform ( const Nimble::Vector4f data)
inline

Constructor for 4-dimensional floating point vector Sets Type of this uniform to Float4.

Parameters
dataValue of the uniform
Luminous::ShaderUniform::ShaderUniform ( const Nimble::Matrix2f data)
inline

Constructor for 2x2-dimensional matrix Sets Type of this uniform to Float2x2.

Parameters
dataValue of the uniform
Luminous::ShaderUniform::ShaderUniform ( const Nimble::Matrix3f data)
inline

Constructor for 3x3-dimensional matrix Sets Type of this uniform to Float3x3.

Parameters
dataValue of the uniform
Luminous::ShaderUniform::ShaderUniform ( const Nimble::Matrix4f data)
inline

Constructor for 4x4-dimensional matrix Sets Type of this uniform to Float4x4.

Parameters
dataValue of the uniform

Member Function Documentation

virtual const char* Luminous::ShaderUniform::data ( ) const
inlinevirtual

Returns the pointer to the stored data.

Returns
The pointer to the stored value
virtual Type Luminous::ShaderUniform::type ( ) const
inlinevirtual

Returns the type of the stored data.

Returns
The type of the stored value