- /* Ensure OpenGLES 2.0 context */
- static EGLint ctx_attribs[] = {
-#ifdef GL_ES_VERSION_2_0
- EGL_CONTEXT_CLIENT_VERSION, 2,
-#elif GL_VERSION_ES_CM_1_0 || GL_VERSION_ES_CL_1_0 || GL_VERSION_ES_CM_1_1 || GL_VERSION_ES_CL_1_1
- EGL_CONTEXT_CLIENT_VERSION, 1,
-#endif
- EGL_NONE
- };
-#ifdef GL_ES_VERSION_2_0
- /*
- * As GLES 3.0 is backwards compatible with GLES 2.0, we set 2.0 as default unless the user states a different version.
- * This updates the context attributes and lets us check that the correct version was set when we query it after creation.
- */
- int gles2Ver = fgState.MajorVersion <= 2 ? 2 : fgState.MajorVersion;
- ctx_attribs[1] = gles2Ver;
-#endif
+ /* On GLES, user specifies the target version with glutInitContextVersion */
+ EGLint ctx_attribs[32];
+ int i = 0;
+ ctx_attribs[i++] = EGL_CONTEXT_CLIENT_VERSION;
+ ctx_attribs[i++] = fgState.MajorVersion;
+ ctx_attribs[i++] = EGL_NONE;
+