diff options
author | 2020-12-16 10:03:51 -0600 | |
---|---|---|
committer | 2020-12-16 10:03:51 -0600 | |
commit | 4e391013c8bf8544fb766bee5dbae10cfdbc9d93 (patch) | |
tree | 5272b3d3588a01913854ce4b6e88380909a2a062 /graphics/src/window | |
parent | a42b3c6998274e75fd10f5ff3cecbdb37b9e3895 (diff) | |
download | iced-4e391013c8bf8544fb766bee5dbae10cfdbc9d93.tar.gz iced-4e391013c8bf8544fb766bee5dbae10cfdbc9d93.tar.bz2 iced-4e391013c8bf8544fb766bee5dbae10cfdbc9d93.zip |
don't panic when swapchain frame is outdated
Diffstat (limited to 'graphics/src/window')
-rw-r--r-- | graphics/src/window/compositor.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/graphics/src/window/compositor.rs b/graphics/src/window/compositor.rs index 0bc8cbc8..39485153 100644 --- a/graphics/src/window/compositor.rs +++ b/graphics/src/window/compositor.rs @@ -40,6 +40,9 @@ pub trait Compositor: Sized { /// Draws the output primitives to the next frame of the given [`SwapChain`]. /// + /// This will return an error if drawing could not be completed on this frame. + /// If an error occurs, try calling this again on the next frame. + /// /// [`SwapChain`]: Self::SwapChain fn draw<T: AsRef<str>>( &mut self, @@ -49,5 +52,5 @@ pub trait Compositor: Sized { background_color: Color, output: &<Self::Renderer as iced_native::Renderer>::Output, overlay: &[T], - ) -> mouse::Interaction; + ) -> Result<mouse::Interaction, ()>; } |