Struct radiant_rs::Display
[−]
[src]
pub struct Display { /* fields omitted */ }
A target to render to, e.g. a window or full screen.
Methods
impl Display
[src]
pub fn builder() -> DisplayBuilder
[src]
Returns a display builder for display construction.
Examples
let display = Display::builder().dimensions((640, 480)).vsync().title("Window!").build().unwrap();
pub fn set_title(&self, title: &str)
[src]
Sets the window title.
pub fn show(&self)
[src]
Makes the previously hidden window visible.
pub fn hide(&self)
[src]
Hides the window.
pub fn set_fullscreen(&self) -> Result<()>
[src]
Switches to fullscreen mode on the primary monitor.
pub fn set_fullscreen_on(&self, monitor: Monitor) -> Result<()>
[src]
Switches to fullscreen mode on the given monitor.
pub fn set_windowed(&self)
[src]
Switches to windowed mode.
pub fn prepare_frame(&self)
[src]
Prepares a frame for rendering.
pub fn clear_frame(&self, color: Color)
[src]
Prepares a frame for rendering and clears it.
pub fn swap_frame(&self)
[src]
Swaps current drawing frame with visible frame.
pub fn grab_cursor(&self)
[src]
Enables cursor grab mode. While in this mode, the mouse cursor will be hidden and constrained to the window.
Grab mode will be temporarily released when the window loses focus and automatically restored once it regains focus.
pub fn hide_cursor(&self)
[src]
Hides the mouse cursor while it is inside the window.
pub fn free_cursor(&self)
[src]
Releases a previously grabbed or hidden cursor and makes it visible again.
pub fn set_cursor_position(&self, position: (i32, i32))
[src]
Sets the mouse cursor position.
pub fn dimensions(&self) -> (u32, u32)
[src]
Returns the window dimensions.
pub fn monitors(&self) -> Vec<Monitor>
[src]
Returns a vector of available monitors.
ⓘImportant traits for &'a mut Wpub fn poll_events(&self) -> &Self
[src]
Polls for events like keyboard or mouse input and changes to the window. See
Input
for basic keyboard and mouse support.
pub fn was_closed(&self) -> bool
[src]
Returns true once after the attached window was closed
Trait Implementations
impl Clone for Display
[src]
fn clone(&self) -> Display
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl AsRenderTarget for Display
[src]
fn as_render_target(&self) -> RenderTarget
[src]
Returns a RenderTarget representing a texture or a frame.