Skip to content

Commit

Permalink
Allow hex format int defines in ofShader code. (#6515)
Browse files Browse the repository at this point in the history
  • Loading branch information
prisonerjohn authored and arturoc committed Jan 8, 2020
1 parent 4d341ac commit c4f90bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libs/openFrameworks/gl/ofShader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ bool ofShader::setupShaderFromSource(ofShader::Source && source){
for(auto & define: source.intDefines){
const auto & name = define.first;
const auto & value = define.second;
std::regex re_define("#define[ \t]+" + name + "[ \t]+([0-9]+)");
std::regex re_define("#define[ \t]+" + name + "[ \t]+(([1-9][0-9]*)|(0[xX][0-9a-fA-F]+))");
source.expandedSource = std::regex_replace(source.expandedSource, re_define, "#define " + name + " " + std::to_string(value));
}

Expand Down

0 comments on commit c4f90bc

Please sign in to comment.