goto gl_fail;
}
- /*
- * We need a Core GL 4.1 context in order to use the GL support in
- * the GStreamer media widget backend, but wglCreateContextAttribsARB()
- * may only give us the GL context version that we ask for here, and
- * nothing more. So, if we are asking for a pre-GL 4.1 context,
- * try to ask for a 4.1 context explicitly first. If that is not supported,
- * then we fall back to whatever version that we were asking for (or, even a
- * legacy context if that fails), at a price of not able to have GL support
- * for the media GStreamer backend.
- */
- if (major < 4 || (major == 4 && minor < 1))
- hglrc = create_wgl_context_with_attribs (hdc,
- hglrc_base,
- share,
- flags,
- 4,
- 1,
- is_legacy);
-
- if (hglrc == NULL)
- hglrc = create_wgl_context_with_attribs (hdc,
- hglrc_base,
- share,
- flags,
- major,
- minor,
- is_legacy);
+ hglrc = create_wgl_context_with_attribs (hdc,
+ hglrc_base,
+ share,
+ flags,
+ major,
+ minor,
+ is_legacy);
/* return the legacy context we have if it could be setup properly, in case the 3.0+ context creation failed */
if (hglrc == NULL)
if (!gdk_gl_context_is_api_allowed (context, GDK_GL_API_GL, error))
return 0;
- gdk_gl_context_get_required_version (context, &major, &minor);
debug_bit = gdk_gl_context_get_debug_enabled (context);
compat_bit = gdk_gl_context_get_forward_compatible (context);
+ /*
+ * We may need a Core GL 4.1+ context in order to use the GL support in
+ * the GStreamer media widget backend (such as on Intel drivers), but
+ * wglCreateContextAttribsARB() may only give us the GL context version
+ * that we ask for here, and nothing more. So, improve things here by
+ * asking for the GL version that is reported to us via epoxy_gl_version(),
+ * rather than the default GL core 3.2 context. Save this up in our
+ * GdkGLContext so that subsequent contexts that are shared with this
+ * context are created likewise too.
+ */
+ if (share != NULL)
+ gdk_gl_context_get_required_version (share, &major, &minor);
+ else
+ {
+ major = display_win32->gl_version / 10;
+ minor = display_win32->gl_version % 10;
+ }
+
if (surface != NULL)
hdc = GDK_WIN32_SURFACE (surface)->hdc;
else
/* Ensure that any other context is created with a legacy bit set */
gdk_gl_context_set_is_legacy (context, legacy_bit);
+ gdk_gl_context_set_required_version (context, major, minor);
return GDK_GL_API_GL;
}