From e419500eafed85d4f7b184ddae75c855bdc45200 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Mon, 19 Aug 2024 20:39:22 +0200 Subject: Add mgl_window_get_egl_context --- include/mgl/window/window.h | 1 + src/window/window.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/include/mgl/window/window.h b/include/mgl/window/window.h index 0d2a079..d922238 100644 --- a/include/mgl/window/window.h +++ b/include/mgl/window/window.h @@ -179,5 +179,6 @@ void mgl_window_set_render_blend_func(mgl_window *self); void mgl_window_flush(mgl_window *self); void* mgl_window_get_egl_display(mgl_window *self); +void* mgl_window_get_egl_context(mgl_window *self); #endif /* MGL_WINDOW_H */ diff --git a/src/window/window.c b/src/window/window.c index 1f21e43..6d44dad 100644 --- a/src/window/window.c +++ b/src/window/window.c @@ -2117,3 +2117,11 @@ void* mgl_window_get_egl_display(mgl_window *self) { else return NULL; } + +void* mgl_window_get_egl_context(mgl_window *self) { + x11_context *x11_context = self->context; + if(x11_context->render_api == MGL_RENDER_API_EGL) + return x11_context->egl.egl_context; + else + return NULL; +} -- cgit v1.2.3