|
OpenWalnut
1.2.5
|
This class is able to provide arbitrary values as define statements in GLSL code. More...
#include <WGEShaderDefine.h>
Inheritance diagram for WGEShaderDefine< ValueType >:Public Types | |
| typedef boost::shared_ptr < WGEShaderDefine< ValueType > > | SPtr |
| Shared pointer for this class. | |
| typedef boost::shared_ptr < const WGEShaderDefine < ValueType > > | ConstSPtr |
| A const shared pointer for this class. | |
Public Types inherited from WGEShaderPreprocessor | |
Public Member Functions | |
| WGEShaderDefine (std::string name, ValueType value=ValueType(0)) | |
| Constructs a define with a given name and initial value. | |
| virtual | ~WGEShaderDefine () |
| Destructor. | |
| virtual std::string | process (const std::string &file, const std::string &code) const |
| Process the whole code. | |
| std::string | getName () const |
| Returns the name of the define. | |
| const ValueType & | getValue () const |
| Returns the current value. | |
| void | setValue (const ValueType &value) |
| Sets the new value for this define. | |
Public Member Functions inherited from WGEShaderPreprocessor | |
| WGEShaderPreprocessor () | |
| Default constructor. | |
| virtual | ~WGEShaderPreprocessor () |
| Destructor. | |
| virtual WCondition::SPtr | getChangeCondition () const |
| Returns the condition denoting a change in this preprocessor filter. | |
| void | setActive (bool active=true) |
| (De-)activates the preprocessor. | |
| bool | getActive () const |
| If the preprocessor is active, this returns true. | |
Private Attributes | |
| std::string | m_name |
| The name of the define. | |
| ValueType | m_value |
| The value of the define as a string. | |
Additional Inherited Members | |
Protected Member Functions inherited from WGEShaderPreprocessor | |
| virtual void | updated () |
| Fires m_updateCondition which should denote an update in the preprocessor filter. | |
This class is able to provide arbitrary values as define statements in GLSL code.
Definition at line 39 of file WGEShaderDefine.h.
| typedef boost::shared_ptr< const WGEShaderDefine< ValueType > > WGEShaderDefine< ValueType >::ConstSPtr |
A const shared pointer for this class.
Reimplemented from WGEShaderPreprocessor.
Reimplemented in WGEShaderPropertyDefine< PropertyType >.
Definition at line 50 of file WGEShaderDefine.h.
| typedef boost::shared_ptr< WGEShaderDefine< ValueType > > WGEShaderDefine< ValueType >::SPtr |
Shared pointer for this class.
Reimplemented from WGEShaderPreprocessor.
Reimplemented in WGEShaderPropertyDefine< PropertyType >.
Definition at line 45 of file WGEShaderDefine.h.
| WGEShaderDefine< ValueType >::WGEShaderDefine | ( | std::string | name, |
| ValueType | value = ValueType( 0 ) |
||
| ) |
Constructs a define with a given name and initial value.
| name | name of the define |
| value | the initial value. |
Definition at line 112 of file WGEShaderDefine.h.
|
virtual |
Destructor.
Definition at line 121 of file WGEShaderDefine.h.
| std::string WGEShaderDefine< ValueType >::getName | ( | ) | const |
Returns the name of the define.
Definition at line 138 of file WGEShaderDefine.h.
Referenced by WGEShader::setDefine().
| const ValueType & WGEShaderDefine< ValueType >::getValue | ( | ) | const |
Returns the current value.
Definition at line 144 of file WGEShaderDefine.h.
|
virtual |
Process the whole code.
It is not allowed to modify some internal state in this function because it might be called by several shaders.
| code | the code to process |
| file | the filename of the shader currently processed. Should be used for debugging output. |
Implements WGEShaderPreprocessor.
Definition at line 127 of file WGEShaderDefine.h.
| void WGEShaderDefine< ValueType >::setValue | ( | const ValueType & | value | ) |
Sets the new value for this define.
Causes an reload of all associated shaders.
| value | the new value. |
Definition at line 150 of file WGEShaderDefine.h.
Referenced by WGEShader::setDefine(), and WGEShaderPropertyDefine< PropertyType >::setNewValue().
|
private |
The name of the define.
Definition at line 103 of file WGEShaderDefine.h.
|
private |
The value of the define as a string.
Definition at line 108 of file WGEShaderDefine.h.
1.8.1