OpenWalnut
1.4.0
|
This preprocessor is able to inject code into a shader. More...
#include <WGEShaderCodeInjector.h>
Public Types | |
typedef boost::shared_ptr < WGEShaderCodeInjector > | SPtr |
Shortcut for a shared_ptr. | |
typedef boost::shared_ptr < WGEShaderCodeInjector > | ConstSPtr |
Shortcut for a const shared_ptr. | |
Public Member Functions | |
WGEShaderCodeInjector (std::string keyword) | |
Default constructor. | |
virtual | ~WGEShaderCodeInjector () |
Destructor. | |
virtual std::string | process (const std::string &file, const std::string &code) const |
Process the whole code. | |
void | setCode (std::string code) |
Define the code that replaces the keyword. | |
Private Attributes | |
std::string | m_code |
the custom code. | |
std::string | m_keyword |
What to replace. |
This preprocessor is able to inject code into a shader.
It therefore replaces a specified keyword with code.
Definition at line 37 of file WGEShaderCodeInjector.h.
typedef boost::shared_ptr< WGEShaderCodeInjector > WGEShaderCodeInjector::ConstSPtr |
Shortcut for a const shared_ptr.
Reimplemented from WGEShaderPreprocessor.
Definition at line 48 of file WGEShaderCodeInjector.h.
typedef boost::shared_ptr< WGEShaderCodeInjector > WGEShaderCodeInjector::SPtr |
Shortcut for a shared_ptr.
Reimplemented from WGEShaderPreprocessor.
Definition at line 43 of file WGEShaderCodeInjector.h.
WGEShaderCodeInjector::WGEShaderCodeInjector | ( | std::string | keyword | ) | [explicit] |
Default constructor.
keyword | this is replaced by the custom code if existing. |
Definition at line 35 of file WGEShaderCodeInjector.cpp.
WGEShaderCodeInjector::~WGEShaderCodeInjector | ( | ) | [virtual] |
Destructor.
Definition at line 41 of file WGEShaderCodeInjector.cpp.
std::string WGEShaderCodeInjector::process | ( | const std::string & | file, |
const std::string & | code | ||
) | const [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 46 of file WGEShaderCodeInjector.cpp.
References WGEShaderPreprocessor::getActive(), m_code, and m_keyword.
void WGEShaderCodeInjector::setCode | ( | std::string | code | ) |
Define the code that replaces the keyword.
code | the code. |
Definition at line 74 of file WGEShaderCodeInjector.cpp.
References m_code, and WGEShaderPreprocessor::updated().
std::string WGEShaderCodeInjector::m_code [private] |
the custom code.
Definition at line 83 of file WGEShaderCodeInjector.h.
std::string WGEShaderCodeInjector::m_keyword [private] |