aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-08-07 08:46:54 +0200
committerdec05eba <dec05eba@protonmail.com>2024-08-07 08:46:54 +0200
commit2399d692faab887d598f396324c81648866c16c6 (patch)
tree5b37873ca3380a89149ff0d08122f674a4c9bec6
parent81050e426bbd7e5cd53820ebd3c2a4a42cc18c6f (diff)
Add mgl_window_get_egl_display
-rw-r--r--include/mgl/window/window.h2
-rw-r--r--src/window/window.c8
2 files changed, 10 insertions, 0 deletions
diff --git a/include/mgl/window/window.h b/include/mgl/window/window.h
index f3b40ea..0d2a079 100644
--- a/include/mgl/window/window.h
+++ b/include/mgl/window/window.h
@@ -178,4 +178,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);
+
#endif /* MGL_WINDOW_H */
diff --git a/src/window/window.c b/src/window/window.c
index 701fbb3..03bb45b 100644
--- a/src/window/window.c
+++ b/src/window/window.c
@@ -2109,3 +2109,11 @@ void mgl_window_flush(mgl_window *self) {
mgl_context *context = mgl_get_context();
XFlush(context->connection);
}
+
+void* mgl_window_get_egl_display(mgl_window *self) {
+ x11_context *x11_context = self->context;
+ if(x11_context->render_api == MGL_RENDER_API_EGL)
+ return x11_context->egl.egl_display;
+ else
+ return NULL;
+}