Skip to main content

cranpose_render_wgpu/
present_observer.rs

1/// Platform code the present thread runs around every present to a surface,
2/// for what only the platform can do with its swapchain, such as asking the
3/// display when earlier frames reached the screen.
4pub trait PresentObserver: Send {
5    /// Runs just before `surface` presents a frame.
6    fn before_present(&mut self, surface: &wgpu::Surface<'static>);
7    /// Runs just after `surface` presented it.
8    fn after_present(&mut self, surface: &wgpu::Surface<'static>);
9
10    /// Runs before `surface` is configured anew, while its current swapchain
11    /// still stands. Does nothing unless the platform needs it to.
12    fn before_reconfigure(&mut self, _surface: &wgpu::Surface<'static>) {}
13}