The most effective way, is to obtain this information in the form of preprocessor macro/variable, because it should influence shader code compilation; a uniform variable does not seem to be an optimal solution. If we look at what is already available in GLSL, we can use GL_ES and __VERSION__. I tried the following:
Code: Select all
#if defined GL_ES || __VERSION__ >= 130
#define ES2_GL3
#endif
#ifdef ES2_GL3
...
Anyway, even if __VERSION__ and GL_ES macros are used, they do not reflect setting of the ZApplication.GLBase propety; but just what version of the shading language is available on the device.
The desired solution would be to write code like this:
Code: Select all
#ifdef ES2_GL3
...
#endif
...