From df06a8243004423925a60c09ea015116fff45fa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 28 Feb 2014 14:59:49 +0100 Subject: [PATCH] Android: define GL_ES in GLSL if not defined. My emulator doesn't define that, causing all stock shaders to fail on compilation. --- .../Shaders/Implementation/CreateCompatibilityShader.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Magnum/Shaders/Implementation/CreateCompatibilityShader.cpp b/src/Magnum/Shaders/Implementation/CreateCompatibilityShader.cpp index 1377e6976..04accbfa1 100644 --- a/src/Magnum/Shaders/Implementation/CreateCompatibilityShader.cpp +++ b/src/Magnum/Shaders/Implementation/CreateCompatibilityShader.cpp @@ -44,6 +44,13 @@ Shader createCompatibilityShader(const Version version, const Shader::Type type) shader.addSource("#define DISABLE_GL_ARB_explicit_uniform_location\n"); #endif + /* My Android emulator (running on NVidia) doesn't define GL_ES + preprocessor macro, thus *all* the stock shaders fail to compile */ + /** @todo remove this when Android emulator is sane */ + #ifdef CORRADE_TARGET_ANDROID + shader.addSource("#ifndef GL_ES\n#define GL_ES 1\n#endif\n"); + #endif + shader.addSource(Utility::Resource("MagnumShaders").get("compatibility.glsl")); return shader; }