wayland/gl: Use the GdkGLContext options

https://bugzilla.gnome.org/show_bug.cgi?id=741946
This commit is contained in:
Emmanuele Bassi 2015-01-28 12:29:37 +00:00
parent 3425f7fe5a
commit 42a895e85e

View File

@ -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;