diff options
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, }, ) } |