X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Fgenerate.cpp;h=07181d3583e69fbc1067292bbaddc7855c58a5ac;hb=c2aa5271db88180d995d5c456dc3a6aa9dc24c24;hp=f5b6b7adb91769277f95de93d56d605e38cc88f7;hpb=5f6ee612cb83029de9559bae644c9a3b4e579259;p=libs%2Fgl.git diff --git a/source/glsl/generate.cpp b/source/glsl/generate.cpp index f5b6b7ad..07181d35 100644 --- a/source/glsl/generate.cpp +++ b/source/glsl/generate.cpp @@ -99,9 +99,15 @@ void ConstantSpecializer::visit(VariableDeclaration &var) { RefPtr literal = new Literal; if(var.type=="bool") + { literal->token = (i->second ? "true" : "false"); + literal->value = static_cast(i->second); + } else if(var.type=="int") + { literal->token = lexical_cast(i->second); + literal->value = i->second; + } var.init_expression = literal; } }