wayland: check for API-specific surfaceless extension

It's a whole different extension name for each GL api.
This commit is contained in:
nobled 2011-01-30 22:22:10 +00:00
parent 542717e45b
commit ffd7197dd6

View File

@ -341,6 +341,14 @@ fail:
} }
} }
#if defined(HAVE_COGL_GL)
#define _COGL_SURFACELESS_EXTENSION "EGL_KHR_surfaceless_opengl"
#elif defined(HAVE_COGL_GLES)
#define _COGL_SURFACELESS_EXTENSION "EGL_KHR_surfaceless_gles1"
#elif defined(HAVE_COGL_GLES2)
#define _COGL_SURFACELESS_EXTENSION "EGL_KHR_surfaceless_gles2"
#endif
static gboolean static gboolean
clutter_backend_wayland_create_context (ClutterBackend *backend, clutter_backend_wayland_create_context (ClutterBackend *backend,
GError **error) GError **error)
@ -357,12 +365,12 @@ clutter_backend_wayland_create_context (ClutterBackend *backend,
egl_extensions = eglQueryString (backend_wayland->edpy, EGL_EXTENSIONS); egl_extensions = eglQueryString (backend_wayland->edpy, EGL_EXTENSIONS);
if (!_cogl_check_extension ("EGL_KHR_surfaceless_opengl", egl_extensions)) if (!_cogl_check_extension (_COGL_SURFACELESS_EXTENSION, egl_extensions))
{ {
g_set_error (error, CLUTTER_INIT_ERROR, g_set_error (error, CLUTTER_INIT_ERROR,
CLUTTER_INIT_ERROR_BACKEND, CLUTTER_INIT_ERROR_BACKEND,
"Wayland clients require the " "Wayland clients require the "
"EGL_KHR_surfaceless_opengl extension"); _COGL_SURFACELESS_EXTENSION " extension");
return FALSE; return FALSE;
} }