mirror of
https://github.com/italicsjenga/rust_minifb.git
synced 2025-01-11 11:31:32 +11:00
posix displayhandle
This commit is contained in:
parent
a8d6d94726
commit
467ad2666f
|
@ -1267,6 +1267,14 @@ unsafe impl raw_window_handle::HasRawWindowHandle for Window {
|
|||
fn raw_window_handle(&self) -> raw_window_handle::RawWindowHandle {
|
||||
let mut handle = raw_window_handle::WaylandWindowHandle::empty();
|
||||
handle.surface = self.display.surface.as_ref().c_ptr() as *mut _ as *mut c_void;
|
||||
|
||||
raw_window_handle::RawWindowHandle::Wayland(handle)
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl raw_window_handle::HasRawDisplayHandle for Window {
|
||||
fn raw_display_handle(&self) -> raw_window_handle::RawDisplayHandle {
|
||||
let mut handle = WaylandDisplayHandle::empty();
|
||||
handle.display = self
|
||||
.display
|
||||
.attached_display
|
||||
|
@ -1275,7 +1283,7 @@ unsafe impl raw_window_handle::HasRawWindowHandle for Window {
|
|||
.as_ref()
|
||||
.c_ptr() as *mut _ as *mut c_void;
|
||||
|
||||
raw_window_handle::RawWindowHandle::Wayland(handle)
|
||||
RawDisplayHandle::Wayland(handle)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -334,11 +334,19 @@ unsafe impl raw_window_handle::HasRawWindowHandle for Window {
|
|||
fn raw_window_handle(&self) -> raw_window_handle::RawWindowHandle {
|
||||
let mut handle = raw_window_handle::XlibWindowHandle::empty();
|
||||
handle.window = self.handle;
|
||||
handle.display = self.d.display as *mut core::ffi::c_void;
|
||||
raw_window_handle::RawWindowHandle::Xlib(handle)
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl HasRawDisplayHandle for Window {
|
||||
fn raw_display_handle(&self) -> raw_window_handle::RawDisplayHandle {
|
||||
let mut handle = raw_window_handle::XlibDisplayHandle::empty();
|
||||
handle.display = self.d.display as *mut core::ffi::c_void;
|
||||
|
||||
RawDisplayHandle::Xlib(handle)
|
||||
}
|
||||
}
|
||||
|
||||
impl Window {
|
||||
pub fn new(name: &str, width: usize, height: usize, opts: WindowOptions) -> Result<Window> {
|
||||
let name = match CString::new(name) {
|
||||
|
|
Loading…
Reference in a new issue