2020-02-18 08:48:54 +01:00
|
|
|
//! Configure a [`Renderer`].
|
|
|
|
|
//!
|
|
|
|
|
//! [`Renderer`]: struct.Renderer.html
|
2020-05-19 20:34:17 +02:00
|
|
|
pub use iced_graphics::Antialiasing;
|
2020-02-18 08:48:54 +01:00
|
|
|
|
2020-01-09 18:31:07 +01:00
|
|
|
/// The settings of a [`Renderer`].
|
|
|
|
|
///
|
2020-02-18 08:48:54 +01:00
|
|
|
/// [`Renderer`]: ../struct.Renderer.html
|
2020-02-24 20:08:40 +01:00
|
|
|
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
2020-01-01 17:49:48 +01:00
|
|
|
pub struct Settings {
|
2020-02-24 20:08:40 +01:00
|
|
|
/// The output format of the [`Renderer`].
|
|
|
|
|
///
|
|
|
|
|
/// [`Renderer`]: ../struct.Renderer.html
|
|
|
|
|
pub format: wgpu::TextureFormat,
|
|
|
|
|
|
2020-01-09 18:31:07 +01:00
|
|
|
/// 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]>,
|
2020-02-15 10:08:27 +01:00
|
|
|
|
|
|
|
|
/// The antialiasing strategy that will be used for triangle primitives.
|
2020-02-18 08:48:54 +01:00
|
|
|
pub antialiasing: Option<Antialiasing>,
|
2020-02-15 10:08:27 +01:00
|
|
|
}
|
|
|
|
|
|
2020-02-24 20:08:40 +01:00
|
|
|
impl Default for Settings {
|
|
|
|
|
fn default() -> Settings {
|
|
|
|
|
Settings {
|
|
|
|
|
format: wgpu::TextureFormat::Bgra8UnormSrgb,
|
|
|
|
|
default_font: None,
|
|
|
|
|
antialiasing: None,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|