• Benjamin Otte's avatar
    gdk: Add GdkDisplay::init_gl vfunc · 430b6f8f
    Benjamin Otte authored
    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().
gdkdisplay.h 5.19 KB