Browse Source

Android: define GL_ES in GLSL if not defined.

My emulator doesn't define that, causing all stock shaders to fail on
compilation.
pull/51/head
Vladimír Vondruš 12 years ago
parent
commit
df06a82430
  1. 7
      src/Magnum/Shaders/Implementation/CreateCompatibilityShader.cpp

7
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"); shader.addSource("#define DISABLE_GL_ARB_explicit_uniform_location\n");
#endif #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")); shader.addSource(Utility::Resource("MagnumShaders").get("compatibility.glsl"));
return shader; return shader;
} }

Loading…
Cancel
Save