Struct CanvasInfo

Source
pub struct CanvasInfo {
    pub width: usize,
    pub height: usize,
    pub title: String,
    pub hidpi: bool,
    pub dpi: f64,
    pub show_ms: bool,
    pub render_on_change: bool,
}
Expand description

Information about the Canvas.

Fields§

§width: usize

The width of the canvas, in virtual pixels.

§height: usize

The height of the canvas, in virtual pixels.

§title: String

The base title for the window.

§hidpi: bool

Whether the canvas will render in hidpi mode. Defaults to false.

§dpi: f64

The DPI factor. If hidpi is on, the virtual dimensions are multiplied by this factor to create the actual image resolution. For example, if you’re on a Retina Macbook, this will be 2.0, so the image will be twice the resolution that you specified.

§show_ms: bool

Whether the window title will display the time to render a frame. Defaults to false.

§render_on_change: bool

Only call the render callback if there’s a state change. Defaults to false, which means it will instead render at a fixed framerate.

Auto Trait Implementations§

Blanket Implementations§

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> 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, 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.