[−][src]Struct riddle_platform_winit::Window
A platform native window.
Construct windows using WindowBuilder.
The window is kept open for the lifetime of this object, once it is dropped the window will be closed during the next event loop pump.
Example
let rdl = RiddleLib::new()?; // Create a window let mut window = Some(WindowBuilder::new().build(rdl.context())?); rdl.run(move |rdl| { if window.is_some() { // Drop all handles to the window. It will be closed before the next invocation // of this closure. window.take(); } else { // The window is closed. Exit. rdl.quit(); } })
Implementations
impl Window[src]
pub fn physical_size(&self) -> (u32, u32)[src]
Get the size of the drawable area of the window in pixels
pub fn logical_size(&self) -> LogicalSize[src]
Get the size of the drawable area of the window in logical units.
pub fn scale_factor(&self) -> f64[src]
Get the scale factor of the window, based on how the window manager configures hidpi scaling
pub fn set_title(&self, title: &str)[src]
Set the window title
pub fn subscribe_to_events(&self, sub: &EventSub<PlatformEvent>)[src]
Attach a subscriber to the subset of platform events that relate to this window
Example
let rdl = RiddleLib::new()?; let subscriber: EventSub<PlatformEvent> = EventSub::new(); let window = WindowBuilder::new().build(rdl.context())?; window.subscribe_to_events(&subscriber);
pub fn id(&self) -> WindowId[src]
The window id which is used to identify this window in PlatformEvents
Trait Implementations
impl CloneHandle for Window[src]
type Handle = WindowHandle
The type which represents a strong reference, and which may be dereferenced as Self. Read more
type WeakHandle = WindowWeak
The type which represents a weak reference.
fn clone_handle(&self) -> WindowHandle[src]
fn clone_weak_handle(&self) -> WindowWeak[src]
impl Drop for Window[src]
impl Eq for Window[src]
impl HasRawWindowHandle for Window[src]
fn raw_window_handle(&self) -> RawWindowHandle[src]
impl PartialEq<Window> for Window[src]
impl WindowExt for Window[src]
fn logical_to_physical<L: Into<LogicalVec2>>(&self, vec2: L) -> (u32, u32)[src]
Auto Trait Implementations
impl !RefUnwindSafe for Window
impl Send for Window
impl Sync for Window
impl Unpin for Window
impl !UnwindSafe for Window
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,