From d807ef367e0257ba54f8cf38708a7a61e28a4acb Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Tue, 7 Apr 2020 05:48:21 +0200 Subject: Update `wgpu` to `0.5` in `iced_wgpu` :tada: --- wgpu/src/window/swap_chain.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'wgpu/src/window/swap_chain.rs') 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, }, ) } -- cgit