pub struct PresentThread<'a> { /* private fields */ }Expand description
The thread a WgpuRenderer hands its frames to,
from WgpuRenderer::present_thread.
The thread takes the surface’s images, draws the frames into them and
presents them. Every change of the surface counts a new surface epoch, so
a frame built for the surface as it was is refused instead of drawn.
Implementations§
Source§impl PresentThread<'_>
impl PresentThread<'_>
Sourcepub fn replace_surface(
self,
surface: Surface<'static>,
config: SurfaceConfiguration,
) -> bool
pub fn replace_surface( self, surface: Surface<'static>, config: SurfaceConfiguration, ) -> bool
Gives the thread a (re)created surface, configured as config,
which first shows the default background. Nothing waits for the
thread to set it up: frames published afterwards queue behind it.
False when the thread is gone.
Sourcepub fn reconfigure(self, config: SurfaceConfiguration) -> bool
pub fn reconfigure(self, config: SurfaceConfiguration) -> bool
Configures the thread’s surface as config and waits until the
thread has done it, as a surface the platform hands over anew needs.
Sourcepub fn drop_surface(self) -> bool
pub fn drop_surface(self) -> bool
Drops the thread’s surface and waits until the thread has done it, as when the window that showed it is gone: the thread draws nothing more into it. The renderer stays for the next surface.