From be14aca07506385a209e89cd99256744a7ec3c0f Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Mon, 24 Feb 2020 20:08:40 +0100 Subject: Make output format of `iced_wgpu` configurable --- wgpu/src/settings.rs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'wgpu/src/settings.rs') diff --git a/wgpu/src/settings.rs b/wgpu/src/settings.rs index 65853ce2..f946ce0d 100644 --- a/wgpu/src/settings.rs +++ b/wgpu/src/settings.rs @@ -5,8 +5,13 @@ /// The settings of a [`Renderer`]. /// /// [`Renderer`]: ../struct.Renderer.html -#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)] +#[derive(Debug, Clone, Copy, PartialEq, Eq)] pub struct Settings { + /// The output format of the [`Renderer`]. + /// + /// [`Renderer`]: ../struct.Renderer.html + pub format: wgpu::TextureFormat, + /// The bytes of the font that will be used by default. /// /// If `None` is provided, a default system font will be chosen. @@ -16,6 +21,16 @@ pub struct Settings { pub antialiasing: Option, } +impl Default for Settings { + fn default() -> Settings { + Settings { + format: wgpu::TextureFormat::Bgra8UnormSrgb, + default_font: None, + antialiasing: None, + } + } +} + /// An antialiasing strategy. #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum Antialiasing { -- cgit