[gtk+/wip/ebassi/gl-context-realize: 7/12] gl: Drop OpenGL legacy profile



commit 3d4c55f29ec9b4ec87848c934f5746c1d35a402d
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Wed Jan 28 19:04:22 2015 +0000

    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.

 gdk/gdkglcontext.c         |   12 +-----------
 gdk/gdktypes.h             |   20 +++++++++++++++-----
 gdk/x11/gdkglcontext-x11.c |    6 +-----
 3 files changed, 17 insertions(+), 21 deletions(-)
---
diff --git a/gdk/gdkglcontext.c b/gdk/gdkglcontext.c
index 55ee9f1..3ffaf8f 100644
--- a/gdk/gdkglcontext.c
+++ b/gdk/gdkglcontext.c
@@ -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;
 }
diff --git a/gdk/gdktypes.h b/gdk/gdktypes.h
index 5b0a656..2a377d8 100644
--- a/gdk/gdktypes.h
+++ b/gdk/gdktypes.h
@@ -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,
diff --git a/gdk/x11/gdkglcontext-x11.c b/gdk/x11/gdkglcontext-x11.c
index 8b11c82..cde1e09 100644
--- a/gdk/x11/gdkglcontext-x11.c
+++ b/gdk/x11/gdkglcontext-x11.c
@@ -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;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]