diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2015-01-28 12:29:37 +0000 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2015-02-05 16:27:47 +0000 |
commit | 52570ed5ff66074aa51e9d377554ca8c20e25bd3 (patch) | |
tree | 6052b0e2783f7a0a7394c0f7378c5b8f41175b91 | |
parent | e9276c10804f5e4a7e92ab5307adb849ca18d662 (diff) | |
download | gtk+-52570ed5ff66074aa51e9d377554ca8c20e25bd3.tar.gz |
wayland/gl: Use the GdkGLContext options
https://bugzilla.gnome.org/show_bug.cgi?id=741946
-rw-r--r-- | gdk/wayland/gdkglcontext-wayland.c | 22 |
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; |