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) -> Result<SwapchainImage, SwapchainError>
pub fn acquire_next_image(&mut self) -> 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,
queue_family_index: usize,
queue_index: usize
)
pub fn present_image( &mut self, image: SwapchainImage, queue_family_index: usize, queue_index: usize )
Presents an image which has been previously acquired using
acquire_next_image
.
sourcepub fn set_info(&mut self, info: SwapchainInfo)
pub fn set_info(&mut self, info: SwapchainInfo)
Sets information about this swapchain.
Previously acquired swapchain images should be discarded after calling this function.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Swapchain
impl Send for Swapchain
impl Sync for Swapchain
impl Unpin for Swapchain
impl UnwindSafe for Swapchain
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more