...
 
Commits (2)
......@@ -12,7 +12,7 @@ int main()
});
glsp::state process_state;
const glsp::processed_file file = process_state.preprocess_file("testu.vert");
const glsp::processed_file file = process_state.preprocess_file("test.vert");
if(!file)
{
std::cout << "Failed to process file.\n";
......
......@@ -2,8 +2,13 @@
#include "inc.glsl"
#include MY_EXTERNAL_INCLUDE
#define ENABLE_BACKFACE_CULLING 0
void main()
{
MY_EXTERNAL_DEFINE = vec4(BLUB, BLUB, BLUB, 1) * MY_EXTERNAL_DEFINE;
#if ENABLE_BACKFACE_CULLING
if(det < detEpsilon) return vec3(-1); // no hit
#endif
}
\ No newline at end of file
......@@ -135,7 +135,15 @@ namespace glshader::process::impl::operation
}
if (opstack.empty())
{
std::string val(begin, begin + len);
for(const auto& c : val)
{
if (!(c >= '0' && c <= '9'))
return 0;
}
return std::stoi(std::string(begin, begin + len));
}
eval_op ox = opstack.front().o;
auto limit = opstack.begin();
......
......@@ -314,7 +314,8 @@ namespace glshader::process
}
auto line_str = line.str();
auto str = macro::expand(line_str.c_str(), text_ptr, current_file, current_line, processed);
const char* none;
auto str = macro::expand(line_str.c_str(), none, current_file, current_line, processed);
evaluated = impl::operation::eval(str.data(), static_cast<int>(str.length()), current_file, current_line, processed);
}
......