pub struct Swapchain { /* private fields */ }Expand description
Provides the ability to present rendering results to a Surface.
Implementations§
Source§impl Swapchain
impl Swapchain
Sourcepub fn new(
device: &Arc<Device>,
surface: Surface,
info: impl Into<SwapchainInfo>,
) -> Result<Self, DriverError>
pub fn new( device: &Arc<Device>, surface: Surface, info: impl Into<SwapchainInfo>, ) -> Result<Self, DriverError>
Prepares a vk::SwapchainKHR object which is lazily created after calling
acquire_next_image.
Sourcepub fn acquire_next_image(
&mut self,
acquired: Semaphore,
) -> Result<SwapchainImage, SwapchainError>
pub fn acquire_next_image( &mut self, acquired: Semaphore, ) -> Result<SwapchainImage, SwapchainError>
Gets the next available swapchain image which should be rendered to and then presented using
present_image.
Sourcepub fn info(&self) -> SwapchainInfo
pub fn info(&self) -> SwapchainInfo
Gets information about this swapchain.
Sourcepub fn present_image(
&mut self,
image: SwapchainImage,
wait_semaphores: &[Semaphore],
queue_family_index: u32,
queue_index: u32,
)
pub fn present_image( &mut self, image: SwapchainImage, wait_semaphores: &[Semaphore], queue_family_index: u32, queue_index: u32, )
Presents an image which has been previously acquired using
acquire_next_image.
Sourcepub fn set_info(&mut self, info: impl Into<SwapchainInfo>)
pub fn set_info(&mut self, info: impl Into<SwapchainInfo>)
Sets information about this swapchain.
Previously acquired swapchain images should be discarded after calling this function.