summaryrefslogtreecommitdiffstats
path: root/wgpu/src/settings.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-02-24 20:08:40 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-02-24 20:08:40 +0100
commitbe14aca07506385a209e89cd99256744a7ec3c0f (patch)
treebc05c7179ade80db61a2009239c9f5c9615181b5 /wgpu/src/settings.rs
parente680fd27e754aead4003cae72f401090662851b2 (diff)
downloadiced-be14aca07506385a209e89cd99256744a7ec3c0f.tar.gz
iced-be14aca07506385a209e89cd99256744a7ec3c0f.tar.bz2
iced-be14aca07506385a209e89cd99256744a7ec3c0f.zip
Make output format of `iced_wgpu` configurable
Diffstat (limited to 'wgpu/src/settings.rs')
-rw-r--r--wgpu/src/settings.rs17
1 files changed, 16 insertions, 1 deletions
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<Antialiasing>,
}
+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 {