mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-25 21:21:21 +00:00
x11: Move GL init code into the GL context
No functional changes, just shuffling code.
This commit is contained in:
parent
b1fbc2ef24
commit
0ddd06113d
@ -1335,25 +1335,6 @@ set_sm_client_id (GdkDisplay *display,
|
||||
gdk_x11_get_xatom_by_name_for_display (display, "SM_CLIENT_ID"));
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_x11_display_init_gl (GdkX11Display *self)
|
||||
{
|
||||
GdkDisplay *display G_GNUC_UNUSED = GDK_DISPLAY (self);
|
||||
|
||||
if (GDK_DISPLAY_DEBUG_CHECK (display, GL_DISABLE))
|
||||
return;
|
||||
|
||||
if (!GDK_DISPLAY_DEBUG_CHECK (display, GL_GLX))
|
||||
{
|
||||
/* We favour EGL */
|
||||
if (gdk_x11_display_init_egl (self))
|
||||
return;
|
||||
}
|
||||
|
||||
if (gdk_x11_display_init_glx (self))
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_x11_display_open:
|
||||
* @display_name: (nullable): name of the X display.
|
||||
|
@ -102,3 +102,23 @@ gdk_x11_display_make_gl_context_current (GdkDisplay *display,
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
gdk_x11_display_init_gl (GdkX11Display *self)
|
||||
{
|
||||
GdkDisplay *display G_GNUC_UNUSED = GDK_DISPLAY (self);
|
||||
|
||||
if (GDK_DISPLAY_DEBUG_CHECK (display, GL_DISABLE))
|
||||
return;
|
||||
|
||||
if (!GDK_DISPLAY_DEBUG_CHECK (display, GL_GLX))
|
||||
{
|
||||
/* We favour EGL */
|
||||
if (gdk_x11_display_init_egl (self))
|
||||
return;
|
||||
}
|
||||
|
||||
if (gdk_x11_display_init_glx (self))
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -60,6 +60,8 @@ struct _GdkX11GLContextClass
|
||||
void (* bind_for_frame_fence) (GdkX11GLContext *self);
|
||||
};
|
||||
|
||||
void gdk_x11_display_init_gl (GdkX11Display *self);
|
||||
|
||||
GdkGLContext * gdk_x11_surface_create_gl_context (GdkSurface *window,
|
||||
gboolean attached,
|
||||
GdkGLContext *share,
|
||||
|
Loading…
Reference in New Issue
Block a user