iced-yoda/wgpu/src/settings.rs

33 lines
759 B
Rust
Raw Normal View History

/// The settings of a [`Renderer`].
///
/// [`Renderer`]: struct.Renderer.html
2020-01-01 17:49:48 +01:00
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
pub struct Settings {
/// The bytes of the font that will be used by default.
///
/// If `None` is provided, a default system font will be chosen.
2020-01-01 17:49:48 +01:00
pub default_font: Option<&'static [u8]>,
/// The antialiasing strategy that will be used for triangle primitives.
pub antialiasing: Option<MSAA>,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum MSAA {
X2,
X4,
X8,
X16,
}
impl MSAA {
pub(crate) fn sample_count(&self) -> u32 {
match self {
MSAA::X2 => 2,
MSAA::X4 => 4,
MSAA::X8 => 8,
MSAA::X16 => 16,
}
}
2020-01-01 17:49:48 +01:00
}