summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdk/wayland/gdkglcontext-wayland.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/gdk/wayland/gdkglcontext-wayland.c b/gdk/wayland/gdkglcontext-wayland.c
index a5fa5df356..88d32232f4 100644
--- a/gdk/wayland/gdkglcontext-wayland.c
+++ b/gdk/wayland/gdkglcontext-wayland.c
@@ -110,14 +110,34 @@ gdk_wayland_gl_context_realize (GdkGLContext *context,
GdkGLProfile profile = gdk_gl_context_get_profile (context);
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
EGLContext ctx;
- EGLint context_attribs[3];
+ EGLint context_attribs[16];
int i;
i = 0;
if (profile == GDK_GL_PROFILE_3_2_CORE)
{
+ int major, minor, flags;
+ gboolean debug_bit, forward_bit;
+
+ gdk_gl_context_get_required_version (context, &major, &minor);
+ debug_bit = gdk_gl_context_get_debug_enabled (context);
+ forward_bit = gdk_gl_context_get_forward_compatible (context);
+
+ flags = 0;
+
+ if (debug_bit)
+ flags |= EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR;
+ if (forward_bit)
+ flags |= EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR;
+
context_attribs[i++] = EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR;
context_attribs[i++] = EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR;
+ context_attribs[i++] = EGL_CONTEXT_MAJOR_VERSION_KHR;
+ context_attribs[i++] = major;
+ context_attribs[i++] = EGL_CONTEXT_MINOR_VERSION_KHR;
+ context_attribs[i++] = minor;
+ context_attribs[i++] = EGL_CONTEXT_FLAGS_KHR;
+ context_attribs[i++] = flags;
}
context_attribs[i++] = EGL_NONE;