···330330 return XRT_ERROR_OPENGL;
331331 }
332332333333+334334+ /*
335335+ * Some sanity checking.
336336+ */
337337+338338+ if (glGetString == NULL) {
339339+ EGL_ERROR("glGetString not loaded!");
340340+ restore_context(&old);
341341+ return XRT_ERROR_OPENGL;
342342+ }
343343+344344+ EGL_DEBUG("EGL made context:\n\tGL_VERSION: %s\n\tGL_RENDERER: %s\n\tGL_VENDOR: %s", //
345345+ glGetString(GL_VERSION), glGetString(GL_RENDERER), glGetString(GL_VENDOR));
346346+347347+ /*
348348+ * If a renderer is old enough to not support OpenGL(ES) 3 or above
349349+ * it won't support Monado at all, it's not a hard requirement and
350350+ * lets us detect weird errors early on some platforms.
351351+ */
352352+ if (!GLAD_GL_VERSION_3_0 && !GLAD_GL_ES_VERSION_3_0) {
353353+ switch (egl_client_type) {
354354+ default: EGL_ERROR("Unknown OpenGL version!"); break;
355355+ case EGL_OPENGL_API: EGL_ERROR("OpenGL 3.0 or above!"); break;
356356+ case EGL_OPENGL_ES_API: EGL_ERROR("OpenGL ES 3.0 or above!"); break;
357357+ }
358358+359359+ restore_context(&old);
360360+ return XRT_ERROR_OPENGL;
361361+ }
362362+363363+364364+ /*
365365+ * Now do the allocation and init.
366366+ */
367367+333368 struct client_egl_compositor *ceglc = U_TYPED_CALLOC(struct client_egl_compositor);
334369 ceglc->current.dpy = display;
335370 ceglc->current.ctx = context;