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<()>
the images for the size the window has now, without waiting (any thread)
Sourcepub fn flush(&self) -> Result<bool>
pub fn flush(&self) -> Result<bool>
the frame on its way: finished by the GPU -> it goes to the window; -> still on its way
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: soon when the GPU is drawing; when the display’s answer is overdue if it has not given it (the answer itself ends the wait earlier); else retry, the caller’s time
Sourcepub fn prepare(&mut self) -> Result<bool>
pub fn prepare(&mut self) -> Result<bool>
the images to the display, its answer there (the window loop’s thread)
Sourcepub fn damage(&self, rects: Option<&[[i32; 4]]>)
pub fn damage(&self, rects: Option<&[[i32; 4]]>)
what the next presented image changes against the last one: rectangles x, y, w, h (None: all)
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, rebuilt when stale; waits (the display is pumped, events stay queued); 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); it goes to the window when the GPU has finished it (flush)
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
pub fn present_mode(&self) -> PresentMode
pub fn format(&self) -> Format
pub fn image_count(&self) -> usize
Sourcepub fn drm_format(&self) -> (u32, u64)
pub fn drm_format(&self) -> (u32, u64)
the images’ DRM format and modifier (tests, traces)