mirror of
https://github.com/italicsjenga/rust_minifb.git
synced 2024-12-23 19:31:30 +11:00
Added proper access to HasRawWindowHandle
This commit is contained in:
parent
cf64bf872b
commit
745cfec45e
|
@ -4,6 +4,8 @@
|
||||||
//!
|
//!
|
||||||
#![deny(missing_debug_implementations)]
|
#![deny(missing_debug_implementations)]
|
||||||
|
|
||||||
|
extern crate raw_window_handle;
|
||||||
|
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use std::os::raw;
|
use std::os::raw;
|
||||||
|
|
||||||
|
@ -91,6 +93,7 @@ pub trait InputCallback {
|
||||||
mod error;
|
mod error;
|
||||||
pub use self::error::Error;
|
pub use self::error::Error;
|
||||||
pub type Result<T> = std::result::Result<T, Error>;
|
pub type Result<T> = std::result::Result<T, Error>;
|
||||||
|
pub use raw_window_handle::HasRawWindowHandle as HasRawWindowHandle;
|
||||||
|
|
||||||
mod key;
|
mod key;
|
||||||
pub use key::Key;
|
pub use key::Key;
|
||||||
|
@ -134,6 +137,12 @@ impl fmt::Debug for Window {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsafe impl raw_window_handle::HasRawWindowHandle for Window {
|
||||||
|
fn raw_window_handle(&self) -> raw_window_handle::RawWindowHandle {
|
||||||
|
self.0.raw_window_handle()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub fn clamp<T: PartialOrd>(low: T, value: T, high: T) -> T {
|
pub fn clamp<T: PartialOrd>(low: T, value: T, high: T) -> T {
|
||||||
if value < low {
|
if value < low {
|
||||||
low
|
low
|
||||||
|
|
Loading…
Reference in a new issue