Merge pull request #629 from hecrj/wgpu-present-mode-setting
Add `present_mode` field to `iced_wgpu::Settings`
This commit is contained in:
commit
8f081bad77
|
@ -11,6 +11,11 @@ pub struct Settings {
|
||||||
/// [`Renderer`]: ../struct.Renderer.html
|
/// [`Renderer`]: ../struct.Renderer.html
|
||||||
pub format: wgpu::TextureFormat,
|
pub format: wgpu::TextureFormat,
|
||||||
|
|
||||||
|
/// The present mode of the [`Renderer`].
|
||||||
|
///
|
||||||
|
/// [`Renderer`]: ../struct.Renderer.html
|
||||||
|
pub present_mode: wgpu::PresentMode,
|
||||||
|
|
||||||
/// The bytes of the font that will be used by default.
|
/// The bytes of the font that will be used by default.
|
||||||
///
|
///
|
||||||
/// If `None` is provided, a default system font will be chosen.
|
/// If `None` is provided, a default system font will be chosen.
|
||||||
|
@ -29,6 +34,7 @@ impl Default for Settings {
|
||||||
fn default() -> Settings {
|
fn default() -> Settings {
|
||||||
Settings {
|
Settings {
|
||||||
format: wgpu::TextureFormat::Bgra8UnormSrgb,
|
format: wgpu::TextureFormat::Bgra8UnormSrgb,
|
||||||
|
present_mode: wgpu::PresentMode::Mailbox,
|
||||||
default_font: None,
|
default_font: None,
|
||||||
default_text_size: 20,
|
default_text_size: 20,
|
||||||
antialiasing: None,
|
antialiasing: None,
|
||||||
|
|
|
@ -111,9 +111,9 @@ impl iced_graphics::window::Compositor for Compositor {
|
||||||
&wgpu::SwapChainDescriptor {
|
&wgpu::SwapChainDescriptor {
|
||||||
usage: wgpu::TextureUsage::OUTPUT_ATTACHMENT,
|
usage: wgpu::TextureUsage::OUTPUT_ATTACHMENT,
|
||||||
format: self.settings.format,
|
format: self.settings.format,
|
||||||
|
present_mode: self.settings.present_mode,
|
||||||
width,
|
width,
|
||||||
height,
|
height,
|
||||||
present_mode: wgpu::PresentMode::Mailbox,
|
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue