Make output format of iced_wgpu configurable

This commit is contained in:
Héctor Ramón Jiménez 2020-02-24 20:08:40 +01:00
parent e680fd27e7
commit be14aca075
11 changed files with 69 additions and 22 deletions

View file

@ -40,11 +40,12 @@ pub fn main() {
});
let surface = wgpu::Surface::create(&window);
let format = wgpu::TextureFormat::Bgra8UnormSrgb;
let mut swap_chain = {
let size = window.inner_size();
SwapChain::new(&device, &surface, size.width, size.height)
SwapChain::new(&device, &surface, format, size.width, size.height)
};
let mut resized = false;
@ -163,6 +164,7 @@ pub fn main() {
swap_chain = SwapChain::new(
&device,
&surface,
format,
size.width,
size.height,
);