radiant_rs

Struct Display

Source
pub struct Display { /* private fields */ }
Expand description

A target to render to, e.g. a window or full screen.

Implementations§

Source§

impl Display

Source

pub fn builder() -> DisplayBuilder

Returns a display builder for display construction.

§Examples
let display = Display::builder().dimensions((640, 480)).vsync().title("Window!").build().unwrap();
Source

pub fn set_title(&self, title: &str)

Sets the window title.

Source

pub fn show(&self)

Makes the previously hidden window visible.

Source

pub fn hide(&self)

Hides the window.

Source

pub fn set_fullscreen(&self) -> Result<()>

Switches to fullscreen mode on the primary monitor.

Source

pub fn set_fullscreen_on(&self, monitor: Monitor) -> Result<()>

Switches to fullscreen mode on the given monitor.

Source

pub fn set_windowed(&self)

Switches to windowed mode.

Source

pub fn prepare_frame(&self)

Prepares a frame for rendering.

Source

pub fn clear_frame(&self, color: Color)

Prepares a frame for rendering and clears it.

Source

pub fn swap_frame(&self)

Swaps current drawing frame with visible frame.

Source

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.

Source

pub fn hide_cursor(&self)

Hides the mouse cursor while it is inside the window.

Source

pub fn free_cursor(&self)

Releases a previously grabbed or hidden cursor and makes it visible again.

Source

pub fn set_cursor_position(&self, position: (i32, i32))

Sets the mouse cursor position.

Source

pub fn dimensions(&self) -> (u32, u32)

Returns the window dimensions.

Source

pub fn monitors(&self) -> Vec<Monitor>

Returns a vector of available monitors.

Source

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.

Source

pub fn was_closed(&self) -> bool

Returns true once after the attached window was closed

Trait Implementations§

Source§

impl AsRenderTarget for Display

Source§

fn as_render_target(&self) -> RenderTarget

Returns a RenderTarget representing a texture or a frame.
Source§

impl Clone for Display

Source§

fn clone(&self) -> Display

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Display

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Display

§

impl !RefUnwindSafe for Display

§

impl !Send for Display

§

impl !Sync for Display

§

impl Unpin for Display

§

impl !UnwindSafe for Display

Blanket Implementations§

Source§

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
where T: Float, Swp: WhitePoint, Dwp: WhitePoint, D: AdaptFrom<S, Swp, Dwp, T>,

Source§

fn adapt_into_using<M>(self, method: M) -> D
where M: TransformMatrix<Swp, Dwp, T>,

Convert the source color to the destination color using the specified method
Source§

fn adapt_into(self) -> D

Convert the source color to the destination color using the bradford method by default
Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize = _

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> SetParameter for T

Source§

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result
where T: Parameter<Self>,

Sets value as a parameter of self.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Erased for T