From: Mikko Rasa Date: Tue, 14 Nov 2017 10:56:34 +0000 (+0200) Subject: Fix shader version declaration when minor version is zero X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=0ebc82fb851d01a6d7f1fc74a4be6612bc575bb4;p=libs%2Fgl.git Fix shader version declaration when minor version is zero --- diff --git a/source/programcompiler.cpp b/source/programcompiler.cpp index 6b8eb6e6..697ec219 100644 --- a/source/programcompiler.cpp +++ b/source/programcompiler.cpp @@ -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';