- printf("Using EGL version %d.%d\n", eglMajor, eglMinor);
- eglBindAPI(EGL_OPENGL_API);
+ printf("Using EGL version: %d.%d\n", eglMajor, eglMinor);
+ if (eglMajor == 1 && eglMinor < 3) {
+ // Choosing the GL context version requires EGL 1.3
+ fprintf(stderr, "Need at least EGL 1.3 to function properly\n");
+ exit(1);
+ }
+#ifdef CON_GLES2
+ if (eglBindAPI(EGL_OPENGL_ES_API) == EGL_FALSE)
+#else
+ if (eglBindAPI(EGL_OPENGL_API) == EGL_FALSE)
+#endif
+ exitEglError("Failed to bind API");