diff options
author | 2020-04-07 05:48:21 +0200 | |
---|---|---|
committer | 2020-04-07 05:48:21 +0200 | |
commit | d807ef367e0257ba54f8cf38708a7a61e28a4acb (patch) | |
tree | 1ee065aa7f47cc9a3e3e642c9b58576dd54d3327 /wgpu/src/window/swap_chain.rs | |
parent | 703beae05ec2988b9a6b15e84291ec818b37bf5b (diff) | |
download | iced-d807ef367e0257ba54f8cf38708a7a61e28a4acb.tar.gz iced-d807ef367e0257ba54f8cf38708a7a61e28a4acb.tar.bz2 iced-d807ef367e0257ba54f8cf38708a7a61e28a4acb.zip |
Update `wgpu` to `0.5` in `iced_wgpu` :tada:
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, }, ) } |