GUInity
|
#include <Holder.hpp>
Public Member Functions | |
Holder (ShaderParamType type, float val) | |
Holder (ShaderParamType type, const glm::vec4 &val) | |
Holder (ShaderParamType type, shared_ptr< Texture > val) | |
bool | isFloat () const |
bool | isVec4 () const |
bool | isTexture () const |
float | getFloat () const |
glm::vec4 | getVec4 () const |
shared_ptr< Texture > | getTexture () const |
Holder is a class that can hold multiple values. It's used by Materials and Shaders because each shader can contain several input parameters such as float values and Textures.
|
explicit |
The explicit is very important here because we don't want any implicit conversions among types Constructor for a float
Constructor for a float
|
explicit |
Constructor for a vec4
|
explicit |
Constructor for a Texture
float Holder::getFloat | ( | ) | const |
returns the float value
glm::vec4 Holder::getVec4 | ( | ) | const |
returns the vec4 value
returns the vec3 value
bool Holder::isFloat | ( | ) | const |
returns true if it is a float value
bool Holder::isTexture | ( | ) | const |
returns true if it is a Texture value
bool Holder::isVec4 | ( | ) | const |
returns true if it is a vec4 value
returns true if it is a vec3 value