18class OpenGLRenderingContextGtk:
public OpenGLRenderingContext,
public RenderingContextGtk {
21 : OpenGLRenderingContext(config), RenderingContextGtk(window) {}
23 ~OpenGLRenderingContextGtk()
override =
default;
24 void init(
const Init& init)
override;
25 void destroyNativeWindow(
AWindowBase& window)
override;
26 void gtkRealize(aui::gtk4_fake::GtkWidget* widget)
override;
27 void gtkSnapshot(aui::gtk4_fake::GtkWidget* widget, aui::gtk4_fake::GtkSnapshot* snapshot)
override;
28 void gtkUnrealize(aui::gtk4_fake::GtkWidget* widget)
override;
34 auto prev = gdk_gl_context_get_current();
35 auto ctx = ourContext;
38 gdk_gl_context_make_current(ctx);
41 gdk_gl_context_clear_current();
42 gdk_gl_context_make_current(prev);
45 void gtkDoUnderContext(
const std::function<
void()>& callback)
override;
49 aui::gtk4_fake::GdkGLTextureBuilder* builder {};
50 aui::gtk4_fake::GdkTexture* gl_texture {};
51 aui::gtk4_fake::GdkTexture* dmabuf_texture {};
56 static aui::gtk4_fake::GdkGLContext* ourContext;
57 GLuint mFramebufferForGtk = 0;
58 bool mNeedsResize =
false;
59 bool mHaveBuffers =
false;
60 aui::gtk4_fake::GdkGLAPI mAllowedApis =
static_cast<aui::gtk4_fake::GdkGLAPI
>(aui::gtk4_fake::GDK_GL_API_GL | aui::gtk4_fake::GDK_GL_API_GLES);
62 void realCreateContext(aui::gtk4_fake::GtkWidget* widget);
63 void ensureTexture(aui::gtk4_fake::GtkWidget* widget);
64 void allocateTexture(aui::gtk4_fake::GtkWidget* widget);
65 void ensureBuffers(aui::gtk4_fake::GtkWidget* widget);
66 void attachBuffers(aui::gtk4_fake::GtkWidget* widget);
68 void deleteTextures();
71 void endFramebuffer()
override;
Provides a fake implementation of GTK4 types and constants, so we wont depend on the gtk4 dev package...
Definition gtk_functions.h:16
Definition ARenderingContextOptions.h:55
Definition IRenderingContext.h:38
static _unique< T, Deleter > make_unique_with_deleter(T *ptr, Deleter deleter=Deleter{})
Creates unique_ptr from raw pointer and a deleter.
Definition SharedPtrTypes.h:126