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]
impl Display
pub fn builder() -> DisplayBuilder
[src]
pub fn builder() -> DisplayBuilder
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]
pub fn set_title(&self, title: &str)
Sets the window title.
pub fn show(&self)
[src]
pub fn show(&self)
Makes the previously hidden window visible.
pub fn hide(&self)
[src]
pub fn hide(&self)
Hides the window.
pub fn set_fullscreen(&self) -> Result<()>
[src]
pub fn set_fullscreen(&self) -> Result<()>
Switches to fullscreen mode on the primary monitor.
pub fn set_fullscreen_on(&self, monitor: Monitor) -> Result<()>
[src]
pub fn set_fullscreen_on(&self, monitor: Monitor) -> Result<()>
Switches to fullscreen mode on the given monitor.
pub fn set_windowed(&self)
[src]
pub fn set_windowed(&self)
Switches to windowed mode.
pub fn prepare_frame(&self)
[src]
pub fn prepare_frame(&self)
Prepares a frame for rendering.
pub fn clear_frame(&self, color: Color)
[src]
pub fn clear_frame(&self, color: Color)
Prepares a frame for rendering and clears it.
pub fn swap_frame(&self)
[src]
pub fn swap_frame(&self)
Swaps current drawing frame with visible frame.
pub fn grab_cursor(&self)
[src]
pub fn grab_cursor(&self)
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]
pub fn hide_cursor(&self)
Hides the mouse cursor while it is inside the window.
pub fn free_cursor(&self)
[src]
pub fn free_cursor(&self)
Releases a previously grabbed or hidden cursor and makes it visible again.
pub fn set_cursor_position(&self, position: (i32, i32))
[src]
pub fn set_cursor_position(&self, position: (i32, i32))
Sets the mouse cursor position.
pub fn dimensions(&self) -> (u32, u32)
[src]
pub fn dimensions(&self) -> (u32, u32)
Returns the window dimensions.
pub fn monitors(&self) -> Vec<Monitor>
[src]
pub fn monitors(&self) -> Vec<Monitor>
Returns a vector of available monitors.
ⓘImportant traits for &'a mut Rpub fn poll_events(&self) -> &Self
[src]
pub fn poll_events(&self) -> &Self
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]
pub fn was_closed(&self) -> bool
Returns true once after the attached window was closed
Trait Implementations
impl Clone for Display
[src]
impl Clone for Display
fn clone(&self) -> Display
[src]
fn clone(&self) -> Display
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for Display
[src]
impl Debug for Display
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl AsRenderTarget for Display
[src]
impl AsRenderTarget for Display
fn as_render_target(&self) -> RenderTarget
[src]
fn as_render_target(&self) -> RenderTarget
Returns a RenderTarget representing a texture or a frame.