Skip to content

Commit

Permalink
feat: wayland opengl session
Browse files Browse the repository at this point in the history
  • Loading branch information
technobaboo authored and Ralith committed Jan 1, 2024
1 parent 0177d2d commit 0c75305
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion openxr/src/graphics/opengl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}

Expand Down Expand Up @@ -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,
},
}

0 comments on commit 0c75305

Please sign in to comment.