30 #include <boost/regex.hpp>
32 #include "../../common/WLogger.h"
33 #include "WGEShaderCodeInjector.h"
36 m_keyword( std::string(
"%" ) + keyword + std::string(
"%" ) )
59 std::stringstream completeCode( code );
60 std::ostringstream newCode;
61 while( std::getline( completeCode, line ) )
64 if( found != std::string::npos )
68 newCode << line << std::endl;
std::string m_code
the custom code.
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.
std::string m_keyword
What to replace.
WGEShaderCodeInjector(std::string keyword)
Default constructor.
virtual void updated()
Fires m_updateCondition which should denote an update in the preprocessor filter.
bool getActive() const
If the preprocessor is active, this returns true.