aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2022-05-25 17:42:24 +0200
committerSimon Zeni <simon@bl4ckb0ne.ca>2022-05-25 18:17:41 +0000
commit452a8ec9401fabc054872fdbd5096c4a87fcea8a (patch)
treef5f919831d97c4474e9c17e8c27143219affbaaa
parent4b77eadf065ace403495ff1f3e7d19a5b7a85cf7 (diff)
render/egl: add wlr_egl_get_{context,display}
This allows compositors to integrate with the wlroots GLES2 renderer, if they need to perform custom GL rendering.
-rw-r--r--include/wlr/render/egl.h16
-rw-r--r--render/egl.c8
2 files changed, 24 insertions, 0 deletions
diff --git a/include/wlr/render/egl.h b/include/wlr/render/egl.h
index 81d4dfa4..06222237 100644
--- a/include/wlr/render/egl.h
+++ b/include/wlr/render/egl.h
@@ -71,6 +71,22 @@ struct wlr_egl *wlr_egl_create_with_context(EGLDisplay display,
EGLContext context);
/**
+ * Get the EGL display used by the struct wlr_egl.
+ *
+ * This is typically used by compositors which need to perform custom OpenGL
+ * operations.
+ */
+EGLDisplay wlr_egl_get_display(struct wlr_egl *egl);
+
+/**
+ * Get the EGL context used by the struct wlr_egl.
+ *
+ * This is typically used by compositors which need to perform custom OpenGL
+ * operations.
+ */
+EGLContext wlr_egl_get_context(struct wlr_egl *egl);
+
+/**
* Make the EGL context current.
*
* Callers are expected to clear the current context when they are done by
diff --git a/render/egl.c b/render/egl.c
index 81ce3b26..dfba8edd 100644
--- a/render/egl.c
+++ b/render/egl.c
@@ -583,6 +583,14 @@ void wlr_egl_destroy(struct wlr_egl *egl) {
free(egl);
}
+EGLDisplay wlr_egl_get_display(struct wlr_egl *egl) {
+ return egl->display;
+}
+
+EGLContext wlr_egl_get_context(struct wlr_egl *egl) {
+ return egl->context;
+}
+
bool wlr_egl_destroy_image(struct wlr_egl *egl, EGLImage image) {
if (!egl->exts.KHR_image_base) {
return false;