X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Foutput.cpp;h=6b76167468b73d52b16d67e78995dc0961c6c62d;hb=0c52167231a1312d2771afbc126c5b61e7d08d0f;hp=6ba06447a3b02e6254b128884c72a206813ee22b;hpb=e9a898f315b5d1396f196d785913a283c30940f2;p=libs%2Fgl.git diff --git a/source/glsl/output.cpp b/source/glsl/output.cpp index 6ba06447..6b761674 100644 --- a/source/glsl/output.cpp +++ b/source/glsl/output.cpp @@ -8,16 +8,6 @@ namespace Msp { namespace GL { namespace SL { -Formatter::Formatter(): - stage(0), - source_index(0), - source_line(1), - indent(0), - parameter_list(false), - omit_builtin(false), - r_empty_name(false) -{ } - string Formatter::apply(Stage &s) { stage = &s; @@ -28,7 +18,7 @@ string Formatter::apply(Stage &s) if(ver) { append(format("#version %d%02d", ver.major, ver.minor)); - if(s.required_features.gl_api==OPENGL_ES2 && ver>=Version(3, 0)) + if(s.required_features.target_api==OPENGL_ES && ver>=Version(3, 0)) append(" es"); formatted += '\n'; } @@ -210,7 +200,7 @@ void Formatter::visit(TernaryExpression &ternary) visit_expression(*ternary.condition, ternary.oper, false); append(ternary.oper->token); visit_expression(*ternary.true_expr, ternary.oper, false); - if(ternary.oper->token2) + if(ternary.oper->token2[0]) append(ternary.oper->token2); visit_expression(*ternary.false_expr, ternary.oper, true); }