pub struct Settings {
pub present_mode: PresentMode,
pub internal_backend: Backends,
pub default_font: Option<&'static [u8]>,
pub default_text_size: u16,
pub text_multithreading: bool,
pub antialiasing: Option<Antialiasing>,
}
Expand description
The settings of a Backend
.
Fields
present_mode: PresentMode
The present mode of the Backend
.
internal_backend: Backends
The internal graphics backend to use.
default_font: Option<&'static [u8]>
The bytes of the font that will be used by default.
If None
is provided, a default system font will be chosen.
default_text_size: u16
The default size of text.
By default, it will be set to 20.
text_multithreading: bool
If enabled, spread text workload in multiple threads when multiple cores are available.
By default, it is disabled.
antialiasing: Option<Antialiasing>
The antialiasing strategy that will be used for triangle primitives.
By default, it is None
.
Implementations
sourceimpl Settings
impl Settings
sourcepub fn from_env() -> Self
pub fn from_env() -> Self
Creates new Settings
using environment configuration.
Specifically:
- The
internal_backend
can be configured using theWGPU_BACKEND
environment variable. If the variable is not set, the primary backend will be used. The following values are allowed:vulkan
metal
dx12
dx11
gl
webgpu
primary
Trait Implementations
impl Copy for Settings
impl Eq for Settings
impl StructuralEq for Settings
impl StructuralPartialEq for Settings
Auto Trait Implementations
impl RefUnwindSafe for Settings
impl Send for Settings
impl Sync for Settings
impl Unpin for Settings
impl UnwindSafe for Settings
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
sourceimpl<T> IsDefault for T where
T: Default + PartialEq<T> + Copy,
impl<T> IsDefault for T where
T: Default + PartialEq<T> + Copy,
sourcefn is_default(&self) -> bool
fn is_default(&self) -> bool
Checks that type has a default value.
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more