diff --git a/src/Shaders/DistanceFieldVectorShader.cpp b/src/Shaders/DistanceFieldVectorShader.cpp index 5d39f356c..ce338d938 100644 --- a/src/Shaders/DistanceFieldVectorShader.cpp +++ b/src/Shaders/DistanceFieldVectorShader.cpp @@ -41,11 +41,14 @@ namespace { template DistanceFieldVectorShader::DistanceFieldVectorShader(): transformationProjectionMatrixUniform(0), colorUniform(1), outlineColorUniform(2), outlineRangeUniform(3), smoothnessUniform(4) { Corrade::Utility::Resource rs("MagnumShaders"); + /* Weird bug in GCC 4.5 - cannot use initializer list here, although the + same thing works in PhongShader flawlessly */ #ifndef MAGNUM_TARGET_GLES - Version v = Context::current()->supportedVersion({Version::GL320, Version::GL210}); + std::initializer_list vs{Version::GL320, Version::GL210}; #else - Version v = Context::current()->supportedVersion({Version::GLES300, Version::GLES200}); + std::initializer_list vs{Version::GLES300, Version::GLES200}; #endif + Version v = Context::current()->supportedVersion(vs); Shader vertexShader(v, Shader::Type::Vertex); vertexShader.addSource(rs.get("compatibility.glsl")); diff --git a/src/Shaders/FlatShader.cpp b/src/Shaders/FlatShader.cpp index c447c2f5c..41dbbe81c 100644 --- a/src/Shaders/FlatShader.cpp +++ b/src/Shaders/FlatShader.cpp @@ -41,21 +41,13 @@ template FlatShader::FlatShader(): transform Corrade::Utility::Resource rs("MagnumShaders"); /* Weird bug in GCC 4.5 - cannot use initializer list here, although the - same thing works in PhongShader flawlessly*/ - #ifndef CORRADE_GCC45_COMPATIBILITY - #ifndef MAGNUM_TARGET_GLES - Version v = Context::current()->supportedVersion({Version::GL320, Version::GL210}); - #else - Version v = Context::current()->supportedVersion({Version::GLES300, Version::GLES200}); - #endif - #else + same thing works in PhongShader flawlessly */ #ifndef MAGNUM_TARGET_GLES std::initializer_list vs{Version::GL320, Version::GL210}; #else std::initializer_list vs{Version::GLES300, Version::GLES200}; #endif Version v = Context::current()->supportedVersion(vs); - #endif Shader vertexShader(v, Shader::Type::Vertex); vertexShader.addSource(rs.get("compatibility.glsl")); diff --git a/src/Shaders/VectorShader.cpp b/src/Shaders/VectorShader.cpp index af1c7ba2f..79121d3ac 100644 --- a/src/Shaders/VectorShader.cpp +++ b/src/Shaders/VectorShader.cpp @@ -41,11 +41,14 @@ namespace { template VectorShader::VectorShader(): transformationProjectionMatrixUniform(0), colorUniform(1) { Corrade::Utility::Resource rs("MagnumShaders"); + /* Weird bug in GCC 4.5 - cannot use initializer list here, although the + same thing works in PhongShader flawlessly */ #ifndef MAGNUM_TARGET_GLES - Version v = Context::current()->supportedVersion({Version::GL320, Version::GL210}); + std::initializer_list vs{Version::GL320, Version::GL210}; #else - Version v = Context::current()->supportedVersion({Version::GLES300, Version::GLES200}); + std::initializer_list vs{Version::GLES300, Version::GLES200}; #endif + Version v = Context::current()->supportedVersion(vs); Shader vertexShader(v, Shader::Type::Vertex); vertexShader.addSource(rs.get("compatibility.glsl"));