25 #ifndef WGESHADERDEFINE_H
26 #define WGESHADERDEFINE_H
33 #include "../../common/WStringUtils.h"
34 #include "WGEShaderPreprocessor.h"
39 template<
typename ValueType =
bool >
46 typedef std::shared_ptr< WGEShaderDefine< ValueType > >
SPtr;
51 typedef std::shared_ptr< const WGEShaderDefine< ValueType > >
ConstSPtr;
74 virtual std::string
process(
const std::string& file,
const std::string& code )
const;
110 template<
typename ValueType >
119 template<
typename ValueType >
125 template<
typename ValueType >
135 template<
typename ValueType >
141 template<
typename ValueType >
147 template<
typename ValueType >
This class is able to provide arbitrary values as define statements in GLSL code.
virtual std::string process(const std::string &file, const std::string &code) const
Process the whole code.
ValueType m_value
The value of the define as a string.
void setValue(const ValueType &value)
Sets the new value for this define.
std::string m_name
The name of the define.
WGEShaderDefine(std::string name, ValueType value=ValueType(0))
Constructs a define with a given name and initial value.
std::shared_ptr< const WGEShaderDefine< ValueType > > ConstSPtr
A const shared pointer for this class.
const ValueType & getValue() const
Returns the current value.
std::shared_ptr< WGEShaderDefine< ValueType > > SPtr
Shared pointer for this class.
virtual ~WGEShaderDefine()
Destructor.
std::string getName() const
Returns the name of the define.
Base class for each preprocessing possible to shader code.
std::string toString(const T &value)
Convert a given value to a string.