SettingsBuilder

Struct SettingsBuilder 

Source
pub struct SettingsBuilder { /* private fields */ }
Available on crate features appcore_linked or loaded only.
Expand description

Builder for the Settings struct.

Implementations§

Source§

impl SettingsBuilder

Source

pub fn developer_name(self, developer_name: &str) -> Self

The name of the developer of this app.

This is used to generate a unique path to store local application data on the user’s machine.

Source

pub fn app_name(self, app_name: &str) -> Self

The name of this app.

This is used to generate a unique path to store local application data on the user’s machine.

Source

pub fn filesystem_path(self, filesystem_path: &str) -> Self

The root file path for our file system. You should set this to the relative path where all of your app data is.

This will be used to resolve all file URLs, eg file:///page.html.

This relative path is resolved using the following logic: - Windows: relative to the executable path - Linux: relative to the executable path - macOS: relative to YourApp.app/Contents/Resources/

Source

pub fn load_shaders_from_filesystem( self, load_shaders_from_filesystem: bool, ) -> Self

Whether or not we should load and compile shaders from the file system (eg, from the /shaders/ path, relative to filesystem_path).

If this is false (the default), we will instead load pre-compiled shaders from memory which speeds up application startup time.

Source

pub fn force_cpu_renderer(self, force_cpu_renderer: bool) -> Self

We try to use the GPU renderer when a compatible GPU is detected.

Set this to true to force the engine to always use the CPU renderer.

Source

pub fn build(self, lib: Arc<Library>) -> Option<Settings>

Builds the Settings struct using the settings configured in this builder.

Return None if failed to create Settings.

Trait Implementations§

Source§

impl Default for SettingsBuilder

Source§

fn default() -> SettingsBuilder

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

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.