Add raw-window-handle support to Winit 0.19 and bump version (#1225)

* Add raw-window-handle support to Winit 0.19 and bump version

* Hopefully fix linux and ios builds
This commit is contained in:
Osspial
2019-10-16 22:37:53 -04:00
committed by GitHub
parent 341fe47c56
commit b33fbc0806
10 changed files with 76 additions and 1 deletions

View File

@@ -35,6 +35,8 @@ use platform::platform::raw_input::register_all_mice_and_keyboards_for_raw_input
use platform::platform::util;
use platform::platform::window_state::{CursorFlags, SavedWindow, WindowFlags, WindowState};
use raw_window_handle::{windows::WindowsHandle, RawWindowHandle};
/// The Win32 implementation of the main `Window` object.
pub struct Window {
/// Main handle for the window.
@@ -268,6 +270,15 @@ impl Window {
self.window.0
}
#[inline]
pub fn raw_window_handle(&self) -> RawWindowHandle {
let handle = WindowsHandle {
hwnd: self.window.0 as *mut _,
..WindowsHandle::empty()
};
RawWindowHandle::Windows(handle)
}
#[inline]
pub fn set_cursor(&self, cursor: MouseCursor) {
self.window_state.lock().unwrap().mouse.cursor = cursor;