Skip to main content

PresentObserver

Trait PresentObserver 

Source
pub trait PresentObserver: Send {
    // Required methods
    fn before_present(&mut self, surface: &Surface<'static>);
    fn after_present(&mut self, surface: &Surface<'static>);

    // Provided method
    fn before_reconfigure(&mut self, _surface: &Surface<'static>) { ... }
}
Expand description

Platform code the present thread runs around every present to a surface, for what only the platform can do with its swapchain, such as asking the display when earlier frames reached the screen.

Required Methods§

Source

fn before_present(&mut self, surface: &Surface<'static>)

Runs just before surface presents a frame.

Source

fn after_present(&mut self, surface: &Surface<'static>)

Runs just after surface presented it.

Provided Methods§

Source

fn before_reconfigure(&mut self, _surface: &Surface<'static>)

Runs before surface is configured anew, while its current swapchain still stands. Does nothing unless the platform needs it to.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§