diff options
author | 2020-04-16 04:59:56 +0200 | |
---|---|---|
committer | 2020-04-16 04:59:56 +0200 | |
commit | 99e020c7b5b56d5407e255cdd4258d658e9c5865 (patch) | |
tree | f9e9df4074179ae4c624e81c53051589d1160a60 /wgpu/src/window/swap_chain.rs | |
parent | 4808fcbd7eb29315e66c660a21a18aa6305739b6 (diff) | |
parent | 2fce83b205d533c34dd1ef8f2e5018bd4ff6c920 (diff) | |
download | iced-99e020c7b5b56d5407e255cdd4258d658e9c5865.tar.gz iced-99e020c7b5b56d5407e255cdd4258d658e9c5865.tar.bz2 iced-99e020c7b5b56d5407e255cdd4258d658e9c5865.zip |
Merge pull request #269 from hecrj/update-wgpu
Update `wgpu` to `0.5` in `iced_wgpu`
Diffstat (limited to 'wgpu/src/window/swap_chain.rs')
-rw-r--r-- | wgpu/src/window/swap_chain.rs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/wgpu/src/window/swap_chain.rs b/wgpu/src/window/swap_chain.rs index 4ca2901b..72e58a50 100644 --- a/wgpu/src/window/swap_chain.rs +++ b/wgpu/src/window/swap_chain.rs @@ -32,8 +32,12 @@ impl SwapChain { /// /// [`SwapChain`]: struct.SwapChain.html /// [`Viewport`]: ../struct.Viewport.html - pub fn next_frame(&mut self) -> (wgpu::SwapChainOutput<'_>, &Viewport) { - (self.raw.get_next_texture(), &self.viewport) + pub fn next_frame( + &mut self, + ) -> Result<(wgpu::SwapChainOutput, &Viewport), wgpu::TimeOut> { + let viewport = &self.viewport; + + self.raw.get_next_texture().map(|output| (output, viewport)) } } @@ -51,7 +55,7 @@ fn new_swap_chain( format, width, height, - present_mode: wgpu::PresentMode::Vsync, + present_mode: wgpu::PresentMode::Mailbox, }, ) } |