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]
fn builder() -> DisplayBuilder
[src]
Returns a display builder for display construction.
Examples
let display = Display::builder().dimensions((640, 480)).vsync().title("Window!").build();
fn set_title(&self, title: &str)
[src]
Sets the window title.
fn show(&self)
[src]
Makes the previously hidden window visible.
fn hide(&self)
[src]
Hides the window.
fn set_fullscreen(&self) -> Result<()>
[src]
Switches to fullscreen mode on the primary monitor.
fn set_fullscreen_on(&self, monitor: Monitor) -> Result<()>
[src]
Switches to fullscreen mode on the given monitor.
fn set_windowed(&self)
[src]
Switches to windowed mode.
fn prepare_frame(&self)
[src]
Prepares a frame for rendering.
fn clear_frame(&self, color: Color)
[src]
Prepares a frame for rendering and clears it.
fn swap_frame(&self)
[src]
Swaps current drawing frame with visible frame.
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.
fn hide_cursor(&self)
[src]
Hides the mouse cursor while it is inside the window.
fn free_cursor(&self)
[src]
Releases a previously grabbed or hidden cursor and makes it visible again.
fn set_cursor_position(&self, position: (i32, i32))
[src]
Sets the mouse cursor position.
fn dimensions(&self) -> (u32, u32)
[src]
Returns the window dimensions.
fn monitors(&self) -> Vec<Monitor>
[src]
Returns a vector of available monitors.
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.
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.