From 0c75305b7a5b1c714a7c3da00a7e3b404e826d8b Mon Sep 17 00:00:00 2001 From: Nova Date: Mon, 1 Jan 2024 04:44:22 -0500 Subject: [PATCH] feat: wayland opengl session --- openxr/src/graphics/opengl.rs | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/openxr/src/graphics/opengl.rs b/openxr/src/graphics/opengl.rs index e5ef9d2f..9c9501b3 100644 --- a/openxr/src/graphics/opengl.rs +++ b/openxr/src/graphics/opengl.rs @@ -98,6 +98,26 @@ impl Graphics for OpenGL { ))?; Ok(out) } + SessionCreateInfo::Wayland { display } => { + let binding = sys::GraphicsBindingOpenGLWaylandKHR { + ty: sys::GraphicsBindingOpenGLWaylandKHR::TYPE, + next: ptr::null(), + display, + }; + let info = sys::SessionCreateInfo { + ty: sys::SessionCreateInfo::TYPE, + next: &binding as *const _ as *const _, + create_flags: Default::default(), + system_id: system, + }; + let mut out = sys::Session::NULL; + cvt((instance.fp().create_session)( + instance.as_raw(), + &info, + &mut out, + ))?; + Ok(out) + } } } @@ -137,6 +157,12 @@ pub enum SessionCreateInfo { glx_drawable: GLXDrawable, glx_context: GLXContext, }, + Wayland { + display: *mut wl_display, + }, #[cfg(windows)] - Windows { h_dc: HDC, h_glrc: HGLRC }, + Windows { + h_dc: HDC, + h_glrc: HGLRC, + }, }