diff options
author | Thaddeus Crews <repiteo@outlook.com> | 2024-10-25 13:04:08 -0500 |
---|---|---|
committer | Thaddeus Crews <repiteo@outlook.com> | 2024-10-25 13:04:08 -0500 |
commit | 07e759b74a34e1d58f7704c7f6a68fb53c263247 (patch) | |
tree | 689409a36d3c771252f893132065b4417cd7c058 /drivers/egl/egl_manager.cpp | |
parent | d3298fe73820299d51fa4a7dc0f7d495e303003f (diff) | |
parent | 256699ee317fde9b1712c0ddf12a6903773aaff4 (diff) | |
download | redot-engine-07e759b74a34e1d58f7704c7f6a68fb53c263247.tar.gz |
Merge pull request #97771 from dsnopek/openxr-linux-egl
OpenXR: Add support for Wayland on Linux
Diffstat (limited to 'drivers/egl/egl_manager.cpp')
-rw-r--r-- | drivers/egl/egl_manager.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/egl/egl_manager.cpp b/drivers/egl/egl_manager.cpp index 603dfadd4b..8ca0aa5943 100644 --- a/drivers/egl/egl_manager.cpp +++ b/drivers/egl/egl_manager.cpp @@ -414,6 +414,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 |