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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.