[gtk+/wip/ebassi/gles: 9/17] wayland: Bind the appropriate OpenGL API



commit fafba04ca1565befe50e9ee43a6e73fddc5a7ed6
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Sat Apr 23 10:13:39 2016 +0100

    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 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/gdk/wayland/gdkglcontext-wayland.c b/gdk/wayland/gdkglcontext-wayland.c
index 8ae3942..b43b9b6 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;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]