diff options
| author | David Snopek <dsnopek@gmail.com> | 2024-10-03 10:24:01 -0500 |
|---|---|---|
| committer | David Snopek <dsnopek@gmail.com> | 2024-10-04 11:44:05 -0500 |
| commit | 256699ee317fde9b1712c0ddf12a6903773aaff4 (patch) | |
| tree | 89c2e2e28d514e8f80a785d78435d9b5e05ede51 /drivers | |
| parent | 2e144928793f17ebd70e1475bb7a7f4fd1095484 (diff) | |
| download | redot-engine-256699ee317fde9b1712c0ddf12a6903773aaff4.tar.gz | |
OpenXR: Add support for Wayland on Linux
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/egl/egl_manager.cpp | 24 | ||||
| -rw-r--r-- | drivers/egl/egl_manager.h | 2 |
2 files changed, 26 insertions, 0 deletions
diff --git a/drivers/egl/egl_manager.cpp b/drivers/egl/egl_manager.cpp index 4477ba7752..b25ae1d39f 100644 --- a/drivers/egl/egl_manager.cpp +++ b/drivers/egl/egl_manager.cpp @@ -351,6 +351,30 @@ EGLContext EGLManager::get_context(DisplayServer::WindowID p_window_id) { return display.egl_context; } +EGLDisplay EGLManager::get_display(DisplayServer::WindowID p_window_id) { + GLWindow &glwindow = windows[p_window_id]; + + if (!glwindow.initialized) { + return EGL_NO_CONTEXT; + } + + GLDisplay &display = displays[glwindow.gldisplay_id]; + + return display.egl_display; +} + +EGLConfig EGLManager::get_config(DisplayServer::WindowID p_window_id) { + GLWindow &glwindow = windows[p_window_id]; + + if (!glwindow.initialized) { + return nullptr; + } + + GLDisplay &display = displays[glwindow.gldisplay_id]; + + return display.egl_config; +} + Error EGLManager::initialize(void *p_native_display) { #if defined(GLAD_ENABLED) && !defined(EGL_STATIC) // Loading EGL with a new display gets us just the bare minimum API. We'll then diff --git a/drivers/egl/egl_manager.h b/drivers/egl/egl_manager.h index a4502c0687..9fe9424ce0 100644 --- a/drivers/egl/egl_manager.h +++ b/drivers/egl/egl_manager.h @@ -106,6 +106,8 @@ public: bool is_using_vsync() const; EGLContext get_context(DisplayServer::WindowID p_window_id); + EGLDisplay get_display(DisplayServer::WindowID p_window_id); + EGLConfig get_config(DisplayServer::WindowID p_window_id); Error initialize(void *p_native_display = nullptr); |
