Function vulkano::swapchain::acquire_next_image[][src]

pub fn acquire_next_image<W>(
    swapchain: Arc<Swapchain<W>>,
    timeout: Option<Duration>
) -> Result<(usize, bool, SwapchainAcquireFuture<W>), AcquireError>

Tries to take ownership of an image in order to draw on it.

The function returns the index of the image in the array of images that was returned when creating the swapchain, plus a future that represents the moment when the image will become available from the GPU (which may not be immediately).

If you try to draw on an image without acquiring it first, the execution will block. (TODO behavior may change).

The second field in the tuple in the Ok result is a bool represent if the acquisition was suboptimal. In this case the acquired image is still usable, but the swapchain should be recreated as the Surface’s properties no longer match the swapchain.