diff options
author | Benjamin Otte <otte@redhat.com> | 2021-07-05 01:57:03 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2021-07-22 16:23:56 +0200 |
commit | 430b6f8fb1a8d20a1c1744e291c1ae51fdd6faac (patch) | |
tree | d9d447bff24c22b0c7682cf3d3ac215303ea4509 /gdk/gdkdisplay.h | |
parent | ba3e80cbfac5ca8f7553344b80134b70f749a89a (diff) | |
download | gtk+-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/gdkdisplay.h')
-rw-r--r-- | gdk/gdkdisplay.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gdk/gdkdisplay.h b/gdk/gdkdisplay.h index 97d8e7eee6..9fabac6b50 100644 --- a/gdk/gdkdisplay.h +++ b/gdk/gdkdisplay.h @@ -68,6 +68,10 @@ gboolean gdk_display_is_rgba (GdkDisplay *display); GDK_AVAILABLE_IN_ALL gboolean gdk_display_supports_input_shapes (GdkDisplay *display); +GDK_AVAILABLE_IN_4_4 +gboolean gdk_display_prepare_gl (GdkDisplay *self, + GError **error); + GDK_AVAILABLE_IN_ALL GdkDisplay *gdk_display_get_default (void); |