[][src]Trait amethyst_rendy::rendy::hal::window::Swapchain

pub trait Swapchain<B>: Send + Sync + Any + Debug where
    B: Backend
{ 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>; unsafe fn present<'a, C, S, Iw>(
        &'a self,
        present_queue: &mut CommandQueue<B, C>,
        image_index: u32,
        wait_semaphores: Iw
    ) -> Result<Option<Suboptimal>, PresentError>
    where
        C: Capability,
        Iw: IntoIterator<Item = &'a S>,
        S: 'a + Borrow<<B as Backend>::Semaphore>,
        Self: 'a + Borrow<<B as Backend>::Swapchain>
, { ... }
unsafe fn present_nosemaphores<'a, C>(
        &'a self,
        present_queue: &mut CommandQueue<B, C>,
        image_index: u32
    ) -> Result<Option<Suboptimal>, PresentError>
    where
        C: Capability,
        Self: 'a + Borrow<<B as Backend>::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>

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

Loading content...

Provided methods

unsafe fn present<'a, C, S, Iw>(
    &'a self,
    present_queue: &mut CommandQueue<B, C>,
    image_index: u32,
    wait_semaphores: Iw
) -> Result<Option<Suboptimal>, PresentError> where
    C: Capability,
    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_nosemaphores<'a, C>(
    &'a self,
    present_queue: &mut CommandQueue<B, C>,
    image_index: u32
) -> Result<Option<Suboptimal>, PresentError> where
    C: Capability,
    Self: 'a + Borrow<<B as Backend>::Swapchain>, 

Present one acquired image without any semaphore synchronization.

Loading content...

Implementors

Loading content...