From 5f4822bfd7c94623e0f8b691cdaa28ec532fd771 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 10 Nov 2012 23:37:59 +0100 Subject: [PATCH] GCC 4.5 compatibility: another initializer-list issue in shader. --- src/Shaders/VertexColorShader.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Shaders/VertexColorShader.cpp b/src/Shaders/VertexColorShader.cpp index bb6305b4d..3a270e994 100644 --- a/src/Shaders/VertexColorShader.cpp +++ b/src/Shaders/VertexColorShader.cpp @@ -39,11 +39,22 @@ namespace { template VertexColorShader::VertexColorShader() { 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 + #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"));