I am writing an Android app and am trying to maximize device support as much as possible. This means (for me at least) supporting both OpenGL ES 1.0 and OpenGL ES 2.0, depending on which is available.
Shader compiler support in OpenGL ES 2.0 is optional, but required for my app (unless I use OpenGL ES 1.0, of course), and so far I haven't been able to find any information about availability. So, I need to check whether compiler support is available and, if not, fall back to OpenGL ES 1.0.
The problem is that if I call GLES20.glGetIntegerv(GLES20.GL_SHADER_COMPILER, ...)
to check for support before my onSurfaceCreated(...)
method is called, it returns GL_FALSE
(if I call it inside onSurfaceCreated, it returns GL_TRUE
).
This means I need to create my GL20 Renderer and commit my GLSurfaceView to use GL20 via setEGLContextClientVersion(2)
and setRenderer(myGL20Renderer)
before I can figure out whether that's really what I want to do.
Is there any way around this other than throwing all that setup away again and basically starting over or accepting the fact that my app might crash on systems that say they support GL 2.0, but don't offer shader compilation?