Skip to main content

Window

Trait Window 

Source
pub trait Window: Send {
    // Required methods
    fn size(&self) -> (u32, u32);
    fn logical_size(&self) -> (f32, f32);
    fn scale_factor(&self) -> f64;
    fn set_title(&self, title: &str);
    fn set_cursor(&self, cursor: Cursor);
    fn request_redraw(&self);
    fn is_focused(&self) -> bool;
    fn is_visible(&self) -> bool;
}
Expand description

Window abstraction trait

Implemented by platform-specific window types.

Required Methods§

Source

fn size(&self) -> (u32, u32)

Get window size in physical pixels

Source

fn logical_size(&self) -> (f32, f32)

Get window size in logical pixels

Source

fn scale_factor(&self) -> f64

Get the display scale factor (DPI scaling)

Source

fn set_title(&self, title: &str)

Set the window title

Source

fn set_cursor(&self, cursor: Cursor)

Set the cursor icon

Source

fn request_redraw(&self)

Request a redraw

Source

fn is_focused(&self) -> bool

Check if the window is focused

Source

fn is_visible(&self) -> bool

Check if the window is visible

Implementors§