Struct Conf

Source
pub struct Conf {
    pub window_title: String,
    pub window_width: i32,
    pub window_height: i32,
    pub high_dpi: bool,
    pub fullscreen: bool,
    pub sample_count: i32,
    pub window_resizable: bool,
    pub icon: Option<Icon>,
    pub platform: Platform,
}
Expand description

Describes a hardware and platform-specific setup.

Fields§

§window_title: String

Window title. Defaults to an empty string.

§window_width: i32

Preferred window width (ignored on WASM/Android). Defaults to 800.

§window_height: i32

Preferred window height (ignored on WASM/Android). Defaults to 600.

§high_dpi: bool

If true, the rendering canvas is scaled for HighDPI displays. Defaults to false.

§fullscreen: bool

If true, create the window in fullscreen mode (ignored on WASM/Android). Defaults to false.

§sample_count: i32

MSAA sample count. Defaults to 1.

§window_resizable: bool

If true, the user can resize the window.

§icon: Option<Icon>

Optional icon data used by the OS where applicable:

  • On Windows, taskbar/title bar icon
  • On macOS, Dock/title bar icon
  • TODO: Favicon on HTML5
  • TODO: Taskbar/title bar icon on Linux (depends on WM)
  • Note: on gnome, icon is determined using WM_CLASS (can be set under Platform) and an external .desktop file
§platform: Platform

Platform-specific hints (e.g., context creation, driver settings).

Trait Implementations§

Source§

impl Debug for Conf

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for Conf

Source§

fn default() -> Conf

Returns the “default value” for a type. Read more
Source§

impl From<Conf> for Conf

Source§

fn from(conf: Conf) -> Conf

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for Conf

§

impl RefUnwindSafe for Conf

§

impl Send for Conf

§

impl Sync for Conf

§

impl Unpin for Conf

§

impl UnwindSafe for Conf

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<S> FromSample<S> for S

Source§

fn from_sample_(s: S) -> S

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> ToSample<U> for T
where U: FromSample<T>,

Source§

fn to_sample_(self) -> U

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<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,