gl: Drop OpenGL legacy profile

We simply don't want to care about legacy OpenGL.

All supported platforms also have support for OpenGL ≥ 3.2; it would
complicate the internal code; and would force us to use legacy GL
contexts internally if the first context created by the user is a legacy
GL context, and disable creation of core-3.2 contexts after that.

We will need to fix all our code examples to use the Core 3.2 profile.

https://bugzilla.gnome.org/show_bug.cgi?id=741946
This commit is contained in:
Emmanuele Bassi 2015-01-28 19:04:22 +00:00
parent 6aaa6c337b
commit 4b8b3b431b
4 changed files with 18 additions and 34 deletions

View File

@ -553,11 +553,6 @@ gdk_gl_context_get_required_version (GdkGLContext *context,
switch (priv->profile)
{
case GDK_GL_PROFILE_DEFAULT:
case GDK_GL_PROFILE_LEGACY:
if (major != NULL)
*major = 1;
break;
case GDK_GL_PROFILE_3_2_CORE:
if (major != NULL)
*major = 3;
@ -572,11 +567,6 @@ gdk_gl_context_get_required_version (GdkGLContext *context,
switch (priv->profile)
{
case GDK_GL_PROFILE_DEFAULT:
case GDK_GL_PROFILE_LEGACY:
if (minor != NULL)
*minor = 0;
break;
case GDK_GL_PROFILE_3_2_CORE:
if (minor != NULL)
*minor = 2;
@ -740,7 +730,7 @@ gdk_gl_context_get_profile (GdkGLContext *context)
{
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
g_return_val_if_fail (GDK_IS_GL_CONTEXT (context), GDK_GL_PROFILE_LEGACY);
g_return_val_if_fail (GDK_IS_GL_CONTEXT (context), GDK_GL_PROFILE_DEFAULT);
return priv->profile;
}

View File

@ -435,18 +435,28 @@ struct _GdkPoint
/**
* GdkGLProfile:
* @GDK_GL_PROFILE_DEFAULT: ...
* @GDK_GL_PROFILE_LEGACY: ...
* @GDK_GL_PROFILE_3_2_CORE: ...
* @GDK_GL_PROFILE_DEFAULT: The default profile.
* @GDK_GL_PROFILE_3_2_CORE: Use core 3.2 GL profiles
*
* ...
* The profile to be used when creating a #GdkGLContext.
*
* Since: 3.16
*/
typedef enum {
GDK_GL_PROFILE_DEFAULT,
GDK_GL_PROFILE_LEGACY,
GDK_GL_PROFILE_3_2_CORE
} GdkGLProfile;
/**
* GdkGLError:
* @GDK_GL_ERROR_NOT_AVAILABLE: OpenGL support is not available
* @GDK_GL_ERROR_UNSUPPORTED_FORMAT: The requested visual format is not supported
* @GDK_GL_ERROR_UNSUPPORTED_PROFILE: The requested profile is not supported
*
* Error enumeration for #GdkGLContext.
*
* Since: 3.16
*/
typedef enum {
GDK_GL_ERROR_NOT_AVAILABLE,
GDK_GL_ERROR_UNSUPPORTED_FORMAT,

View File

@ -2742,21 +2742,9 @@ gdk_window_get_paint_gl_context (GdkWindow *window,
window->impl_window->gl_paint_context =
GDK_WINDOW_IMPL_GET_CLASS (window->impl)->create_gl_context (window->impl_window,
TRUE,
GDK_GL_PROFILE_3_2_CORE,
GDK_GL_PROFILE_DEFAULT,
NULL,
&internal_error);
if (window->impl_window->gl_paint_context == NULL &&
g_error_matches (internal_error, GDK_GL_ERROR,
GDK_GL_ERROR_UNSUPPORTED_PROFILE))
{
g_clear_error (&internal_error);
window->impl_window->gl_paint_context =
GDK_WINDOW_IMPL_GET_CLASS (window->impl)->create_gl_context (window->impl_window,
TRUE,
GDK_GL_PROFILE_DEFAULT,
NULL,
&internal_error);
}
}
if (internal_error != NULL)

View File

@ -609,10 +609,6 @@ gdk_x11_gl_context_realize (GdkGLContext *context,
profile = gdk_gl_context_get_profile (context);
share = gdk_gl_context_get_shared_context (context);
/* GDK_GL_PROFILE_DEFAULT is currently equivalent to the LEGACY profile */
if (profile == GDK_GL_PROFILE_DEFAULT)
profile = GDK_GL_PROFILE_LEGACY;
/* we check for the presence of the GLX_ARB_create_context_profile
* extension before checking for a GLXFBConfig.
*/
@ -1193,7 +1189,7 @@ gdk_x11_window_create_gl_context (GdkWindow *window,
display = gdk_window_get_display (window);
/* GDK_GL_PROFILE_DEFAULT is currently equivalent to the LEGACY profile */
/* GDK_GL_PROFILE_DEFAULT is currently equivalent to the 3_2_CORE profile */
if (profile == GDK_GL_PROFILE_DEFAULT)
profile = GDK_GL_PROFILE_3_2_CORE;