summaryrefslogtreecommitdiff
path: root/gdk/gdkdisplayprivate.h
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2021-07-05 01:57:03 +0200
committerBenjamin Otte <otte@redhat.com>2021-07-22 16:23:56 +0200
commit430b6f8fb1a8d20a1c1744e291c1ae51fdd6faac (patch)
treed9d447bff24c22b0c7682cf3d3ac215303ea4509 /gdk/gdkdisplayprivate.h
parentba3e80cbfac5ca8f7553344b80134b70f749a89a (diff)
downloadgtk+-430b6f8fb1a8d20a1c1744e291c1ae51fdd6faac.tar.gz
gdk: Add GdkDisplay::init_gl vfunc
The vfunc is called to initialize GL and it returns a "base" context that GDK then uses as the context all others are shared with. So the GL context share tree now looks like: + context from init_gl - context1 - context2 ... So this is a flat tree now, the complexity is gone. The only caveat is that backends now need to create a GL context when initializing GL so some refactoring was needed. Two new functions have been added: * gdk_display_prepare_gl() This is public API and can be used to ensure that GL has been initialized or if not, retrieve an error to display (or debug-print). * gdk_display_get_gl_context() This is a private function to retrieve the base context from init_gl(). It replaces gdk_surface_get_shared_data_context().
Diffstat (limited to 'gdk/gdkdisplayprivate.h')
-rw-r--r--gdk/gdkdisplayprivate.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/gdk/gdkdisplayprivate.h b/gdk/gdkdisplayprivate.h
index 4aa99c30dd..a2913b50e9 100644
--- a/gdk/gdkdisplayprivate.h
+++ b/gdk/gdkdisplayprivate.h
@@ -140,6 +140,8 @@ struct _GdkDisplayClass
GdkKeymap * (*get_keymap) (GdkDisplay *display);
+ GdkGLContext * (*init_gl) (GdkDisplay *display,
+ GError **error);
gboolean (*make_gl_context_current) (GdkDisplay *display,
GdkGLContext *context);
@@ -206,6 +208,7 @@ GdkSurface * gdk_display_create_surface (GdkDisplay *display
int width,
int height);
+GdkGLContext * gdk_display_get_gl_context (GdkDisplay *display);
gboolean gdk_display_make_gl_context_current (GdkDisplay *display,
GdkGLContext *context);