GUInity
Public Member Functions | List of all members
Holder Class Reference

#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< TexturegetTexture () const
 

Detailed Description

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.

Constructor & Destructor Documentation

Holder::Holder ( ShaderParamType  type,
float  val 
)
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

Holder::Holder ( ShaderParamType  type,
const glm::vec4 &  val 
)
explicit

Constructor for a vec4

Holder::Holder ( ShaderParamType  type,
shared_ptr< Texture val 
)
explicit

Constructor for a Texture

Member Function Documentation

float Holder::getFloat ( ) const

returns the float value

shared_ptr< Texture > Holder::getTexture ( ) const

returns the Texture 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


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