]> git.tdb.fi Git - libs/gl.git/commitdiff
Fix shader version declaration when minor version is zero
authorMikko Rasa <tdb@tdb.fi>
Tue, 14 Nov 2017 10:56:34 +0000 (12:56 +0200)
committerMikko Rasa <tdb@tdb.fi>
Tue, 14 Nov 2017 10:56:34 +0000 (12:56 +0200)
source/programcompiler.cpp

index 6b8eb6e6135ddb68702537cbc4d3c9b626a341c1..697ec2193ed9e022c1bd283f4405f4188ceaf8bb 100644 (file)
@@ -231,9 +231,9 @@ void ProgramCompiler::Formatter::apply(ProgramSyntax::Stage &s)
        GLApi api = get_gl_api();
        const Version &ver = s.required_version;
 
-       if(ver.major)
+       if(ver)
        {
-               formatted += format("#version %d%d", ver.major, ver.minor);
+               formatted += format("#version %d%02d", ver.major, ver.minor);
                if(api==OPENGL_ES2 && ver>=Version(3, 0))
                        formatted += " es";
                formatted += '\n';