[−][src]Trait rendy_core::hal::window::Swapchain
The Swapchain
is the backend representation of the surface.
It consists of multiple buffers, which will be presented on the surface.
Required methods
unsafe fn acquire_image(
&mut self,
timeout_ns: u64,
semaphore: Option<&<B as Backend>::Semaphore>,
fence: Option<&<B as Backend>::Fence>
) -> Result<(u32, Option<Suboptimal>), AcquireError>
&mut self,
timeout_ns: u64,
semaphore: Option<&<B as Backend>::Semaphore>,
fence: Option<&<B as Backend>::Fence>
) -> Result<(u32, Option<Suboptimal>), AcquireError>
Acquire a new swapchain image for rendering. This needs to be called before presenting.
May fail according to one of the reasons indicated in AcquireError
enum.
Synchronization
The acquired image will not be immediately available when the function returns.
Once available the provided Semaphore
and Fence
will be signaled.
Examples
Provided methods
unsafe fn present<'a, S, Iw>(
&'a self,
present_queue: &mut <B as Backend>::CommandQueue,
image_index: u32,
wait_semaphores: Iw
) -> Result<Option<Suboptimal>, PresentError> where
Iw: IntoIterator<Item = &'a S>,
S: 'a + Borrow<<B as Backend>::Semaphore>,
Self: 'a + Borrow<<B as Backend>::Swapchain>,
&'a self,
present_queue: &mut <B as Backend>::CommandQueue,
image_index: u32,
wait_semaphores: Iw
) -> Result<Option<Suboptimal>, PresentError> where
Iw: IntoIterator<Item = &'a S>,
S: 'a + Borrow<<B as Backend>::Semaphore>,
Self: 'a + Borrow<<B as Backend>::Swapchain>,
Present one acquired image.
Safety
The passed queue must support presentation on the surface, which is used for creating this swapchain.
Examples
unsafe fn present_without_semaphores<'a>(
&'a self,
present_queue: &mut <B as Backend>::CommandQueue,
image_index: u32
) -> Result<Option<Suboptimal>, PresentError> where
Self: 'a + Borrow<<B as Backend>::Swapchain>,
&'a self,
present_queue: &mut <B as Backend>::CommandQueue,
image_index: u32
) -> Result<Option<Suboptimal>, PresentError> where
Self: 'a + Borrow<<B as Backend>::Swapchain>,
Present one acquired image without any semaphore synchronization.