gl: Drop profile for gdk_window_create_gl_context()

Now that we have a two-stages GL context creation sequence, we can move
the profile to a pre-realize option, like the debug and forward
compatibility bits, or the GL version to use.
This commit is contained in:
Emmanuele Bassi
2015-02-12 12:34:28 +00:00
parent 015bf99816
commit 022724aa69
14 changed files with 58 additions and 47 deletions

View File

@ -592,8 +592,13 @@ gdk_x11_gl_context_realize (GdkGLContext *context,
profile = gdk_gl_context_get_profile (context);
share = gdk_gl_context_get_shared_context (context);
/* default means 3.2 core profile */
if (profile == GDK_GL_PROFILE_DEFAULT)
profile = GDK_GL_PROFILE_3_2_CORE;
/* we check for the presence of the GLX_ARB_create_context_profile
* extension before checking for a GLXFBConfig.
* extension before checking for a GLXFBConfig when creating the
* GdkX11GLContext instance in gdk_x11_window_create_gl_context().
*/
if (profile == GDK_GL_PROFILE_3_2_CORE)
{
@ -1163,7 +1168,6 @@ _gdk_x11_screen_update_visuals_for_gl (GdkScreen *screen)
GdkGLContext *
gdk_x11_window_create_gl_context (GdkWindow *window,
gboolean attached,
GdkGLProfile profile,
GdkGLContext *share,
GError **error)
{
@ -1174,10 +1178,6 @@ gdk_x11_window_create_gl_context (GdkWindow *window,
display = gdk_window_get_display (window);
/* 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;
if (!gdk_x11_screen_init_gl (gdk_window_get_screen (window)))
{
g_set_error_literal (error, GDK_GL_ERROR,
@ -1186,8 +1186,7 @@ gdk_x11_window_create_gl_context (GdkWindow *window,
return NULL;
}
if (profile == GDK_GL_PROFILE_3_2_CORE &&
!GDK_X11_DISPLAY (display)->has_glx_create_context)
if (!GDK_X11_DISPLAY (display)->has_glx_create_context)
{
g_set_error_literal (error, GDK_GL_ERROR,
GDK_GL_ERROR_UNSUPPORTED_PROFILE,
@ -1204,11 +1203,9 @@ gdk_x11_window_create_gl_context (GdkWindow *window,
context = g_object_new (GDK_TYPE_X11_GL_CONTEXT,
"display", display,
"window", window,
"profile", profile,
"shared-context", share,
NULL);
context->profile = profile;
context->glx_config = config;
context->is_attached = attached;

View File

@ -60,7 +60,6 @@ struct _GdkX11GLContextClass
gboolean gdk_x11_screen_init_gl (GdkScreen *screen);
GdkGLContext * gdk_x11_window_create_gl_context (GdkWindow *window,
gboolean attached,
GdkGLProfile profile,
GdkGLContext *share,
GError **error);
void gdk_x11_window_invalidate_for_new_frame (GdkWindow *window,