iridescence
Loading...
Searching...
No Matches
guik::ShaderParameter Struct Reference

Shader parameter class that holds a single parameter for shader setting. More...

#include <shader_setting.hpp>

Public Member Functions

 ShaderParameter ()
 Default constructor.
template<typename T>
 ShaderParameter (std::uint64_t name, const T &v)
 Constructor.
bool valid () const
 Check if the parameter is valid.
void invalidate ()
 Invalidate the parameter.
template<typename T>
T get_value () const
 Get the parameter value.
template<typename T>
void set_value (const T &value)
 Get the parameter value.
void set (glk::GLSLShader &shader) const
 Set the parameter to the shader.

Public Attributes

ShaderDataType type
 Data type of the parameter.
std::uint64_t name
 Name of the parameter (hashed).
Eigen::Matrix4f mat4f
 Value of the parameter (stored as 4x4 float matrix).

Detailed Description

Shader parameter class that holds a single parameter for shader setting.

Note
The maximum size of the parameter value is 4x4 float matrix.

Constructor & Destructor Documentation

◆ ShaderParameter() [1/2]

guik::ShaderParameter::ShaderParameter ( )
inline

Default constructor.

◆ ShaderParameter() [2/2]

template<typename T>
guik::ShaderParameter::ShaderParameter ( std::uint64_t name,
const T & v )
inline

Constructor.

Member Function Documentation

◆ get_value()

template<typename T>
T guik::ShaderParameter::get_value ( ) const
inline

Get the parameter value.

◆ invalidate()

void guik::ShaderParameter::invalidate ( )
inline

Invalidate the parameter.

◆ set()

void guik::ShaderParameter::set ( glk::GLSLShader & shader) const
inline

Set the parameter to the shader.

◆ set_value()

template<typename T>
void guik::ShaderParameter::set_value ( const T & value)
inline

Get the parameter value.

◆ valid()

bool guik::ShaderParameter::valid ( ) const
inline

Check if the parameter is valid.

Member Data Documentation

◆ mat4f

Eigen::Matrix4f guik::ShaderParameter::mat4f

Value of the parameter (stored as 4x4 float matrix).

◆ name

std::uint64_t guik::ShaderParameter::name

Name of the parameter (hashed).

◆ type

ShaderDataType guik::ShaderParameter::type

Data type of the parameter.


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