]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/output.cpp
Fix a name conflict in certain inlining scenarios
[libs/gl.git] / source / glsl / output.cpp
index 6ba06447a3b02e6254b128884c72a206813ee22b..6b76167468b73d52b16d67e78995dc0961c6c62d 100644 (file)
@@ -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);
 }