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