From 74f4e6e046b890838519e689a48d3dcc252929f7 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Sat, 23 Apr 2016 10:13:39 +0100 Subject: [PATCH] wayland: Bind the appropriate OpenGL API If we want to use OpenGL ES with EGL then we need to bind the API before creating the EGL context. --- gdk/wayland/gdkglcontext-wayland.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gdk/wayland/gdkglcontext-wayland.c b/gdk/wayland/gdkglcontext-wayland.c index 8ae39420d3..b43b9b67c2 100644 --- a/gdk/wayland/gdkglcontext-wayland.c +++ b/gdk/wayland/gdkglcontext-wayland.c @@ -134,6 +134,8 @@ gdk_wayland_gl_context_realize (GdkGLContext *context, if (!use_es) { + eglBindAPI (EGL_OPENGL_API); + /* We want a core profile, unless in legacy mode */ context_attribs[i++] = EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR; context_attribs[i++] = legacy_bit @@ -148,6 +150,8 @@ gdk_wayland_gl_context_realize (GdkGLContext *context, } else { + eglBindAPI (EGL_OPENGL_ES_API); + context_attribs[i++] = EGL_CONTEXT_CLIENT_VERSION; if (major == 3) context_attribs[i++] = 3; @@ -184,6 +188,8 @@ gdk_wayland_gl_context_realize (GdkGLContext *context, context_attribs[3] = 3; context_attribs[5] = 0; + eglBindAPI (EGL_OPENGL_API); + legacy_bit = TRUE; use_es = FALSE;