pub struct Swapchain { /* private fields */ }Expand description
the images a window shows, presented in turn
Implementations§
Source§impl Swapchain
impl Swapchain
Sourcepub fn rebuild(&mut self) -> Result<()>
pub fn rebuild(&mut self) -> Result<()>
(re)create the swapchain for the window’s size now; the old images may still be in use: waits for the queue to be idle (resizes are rare)
Sourcepub fn try_acquire(&mut self) -> Result<TryAcquire>
pub fn try_acquire(&mut self) -> Result<TryAcquire>
the next image to draw into, without waiting and without rebuilding (see TryAcquire)
Sourcepub fn acquire(&mut self) -> Result<Option<Frame>>
pub fn acquire(&mut self) -> Result<Option<Frame>>
the next image to draw into; None while the window is minimised or has no area
Sourcepub fn view(&self, frame: &Frame) -> &TextureView
pub fn view(&self, frame: &Frame) -> &TextureView
the frame’s image as a render target (Undefined at the start, Present at the end)
Sourcepub fn texture(&self, frame: &Frame) -> &Texture
pub fn texture(&self, frame: &Frame) -> &Texture
the frame’s image (copies: SwapchainDesc::copy_src)
Sourcepub fn present<'a, I: IntoIterator<Item = CommandBuffer<'a>>>(
&self,
frame: Frame,
cmds: I,
) -> Result<SubmitId>
pub fn present<'a, I: IntoIterator<Item = CommandBuffer<'a>>>( &self, frame: Frame, cmds: I, ) -> Result<SubmitId>
submit the frame’s commands (they leave the image in Layout::Present) and show it
Sourcepub fn prepare(&mut self) -> Result<bool>
pub fn prepare(&mut self) -> Result<bool>
(Linux: the display has answered for the images; here nothing to wait for)
Sourcepub fn flush(&self) -> Result<bool>
pub fn flush(&self) -> Result<bool>
(Linux: a frame reaches the window after the GPU finished it; here present has done that)
Sourcepub fn next_look(&self, retry: u64) -> u64
pub fn next_look(&self, retry: u64) -> u64
when a frame that found NotReady should try again: retry (the caller’s time)
Sourcepub fn damage(&self, _rects: Option<&[[i32; 4]]>)
pub fn damage(&self, _rects: Option<&[[i32; 4]]>)
(Linux: what the next image changes, for the compositor; here the whole image counts)
Sourcepub fn resize(&mut self)
pub fn resize(&mut self)
rebuild at the next acquire (the window’s size is also checked at every acquire)
Sourcepub fn set_present_mode(&mut self, m: PresentMode)
pub fn set_present_mode(&mut self, m: PresentMode)
another present mode from the next acquire on (FIFO when the surface lacks it)