Update raw-window-handle to 0.4.1 (#1957)
* Update raw-window-handle to `0.4.2` See: - https://github.com/rust-windowing/raw-window-handle/issues/72 - https://github.com/rust-windowing/raw-window-handle/pull/73 - https://github.com/rust-windowing/raw-window-handle/pull/74 * Clean up raw_window_handle functions a bit
This commit is contained in:
parent
29a078f65c
commit
5eb9c9504b
9 changed files with 39 additions and 52 deletions
|
|
@ -12,6 +12,7 @@ use ndk::{
|
|||
looper::{ForeignLooper, Poll, ThreadLooper},
|
||||
};
|
||||
use ndk_glue::{Event, Rect};
|
||||
use raw_window_handle::{AndroidNdkHandle, RawWindowHandle};
|
||||
use std::{
|
||||
collections::VecDeque,
|
||||
sync::{Arc, Mutex, RwLock},
|
||||
|
|
@ -589,15 +590,14 @@ impl Window {
|
|||
))
|
||||
}
|
||||
|
||||
pub fn raw_window_handle(&self) -> raw_window_handle::RawWindowHandle {
|
||||
let a_native_window = if let Some(native_window) = ndk_glue::native_window().as_ref() {
|
||||
unsafe { native_window.ptr().as_mut() as *mut _ as *mut _ }
|
||||
pub fn raw_window_handle(&self) -> RawWindowHandle {
|
||||
let mut handle = AndroidNdkHandle::empty();
|
||||
if let Some(native_window) = ndk_glue::native_window().as_ref() {
|
||||
handle.a_native_window = unsafe { native_window.ptr().as_mut() as *mut _ as *mut _ }
|
||||
} else {
|
||||
panic!("Cannot get the native window, it's null and will always be null before Event::Resumed and after Event::Suspended. Make sure you only call this function between those events.");
|
||||
};
|
||||
let mut handle = raw_window_handle::android::AndroidHandle::empty();
|
||||
handle.a_native_window = a_native_window;
|
||||
raw_window_handle::RawWindowHandle::Android(handle)
|
||||
RawWindowHandle::AndroidNdk(handle)
|
||||
}
|
||||
|
||||
pub fn config(&self) -> Configuration {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue