Struct vulkano::swapchain::Swapchain
[−]
[src]
pub struct Swapchain { /* fields omitted */ }
Contains the swapping system and the images that can be shown on a surface.
Methods
impl Swapchain
[src]
fn new<F, S>(
device: Arc<Device>,
surface: Arc<Surface>,
num_images: u32,
format: F,
dimensions: [u32; 2],
layers: u32,
usage: ImageUsage,
sharing: S,
transform: SurfaceTransform,
alpha: CompositeAlpha,
mode: PresentMode,
clipped: bool,
old_swapchain: Option<&Arc<Swapchain>>
) -> Result<(Arc<Swapchain>, Vec<Arc<SwapchainImage>>), SwapchainCreationError> where
F: FormatDesc,
S: Into<SharingMode>,
[src]
device: Arc<Device>,
surface: Arc<Surface>,
num_images: u32,
format: F,
dimensions: [u32; 2],
layers: u32,
usage: ImageUsage,
sharing: S,
transform: SurfaceTransform,
alpha: CompositeAlpha,
mode: PresentMode,
clipped: bool,
old_swapchain: Option<&Arc<Swapchain>>
) -> Result<(Arc<Swapchain>, Vec<Arc<SwapchainImage>>), SwapchainCreationError> where
F: FormatDesc,
S: Into<SharingMode>,
Builds a new swapchain. Allocates images who content can be made visible on a surface.
See also the Surface::get_capabilities
function which returns the values that are
supported by the implementation. All the parameters that you pass to Swapchain::new
must be supported.
The clipped
parameter indicates whether the implementation is allowed to discard
rendering operations that affect regions of the surface which aren't visible. This is
important to take into account if your fragment shader has side-effects or if you want to
read back the content of the image afterwards.
This function returns the swapchain plus a list of the images that belong to the
swapchain. The order in which the images are returned is important for the
acquire_next_image
and present
functions.
Panic
- Panics if the device and the surface don't belong to the same instance.
- Panics if
usage
is empty.
fn recreate_with_dimension(
&self,
dimensions: [u32; 2]
) -> Result<(Arc<Swapchain>, Vec<Arc<SwapchainImage>>), SwapchainCreationError>
[src]
&self,
dimensions: [u32; 2]
) -> Result<(Arc<Swapchain>, Vec<Arc<SwapchainImage>>), SwapchainCreationError>
Recreates the swapchain with new dimensions.
fn raw_image(&self, offset: usize) -> Option<ImageInner>
[src]
Returns of the images that belong to this swapchain.
fn num_images(&self) -> u32
[src]
Returns the number of images of the swapchain.
See the documentation of Swapchain::new
.
fn format(&self) -> Format
[src]
Returns the format of the images of the swapchain.
See the documentation of Swapchain::new
.
fn dimensions(&self) -> [u32; 2]
[src]
Returns the dimensions of the images of the swapchain.
See the documentation of Swapchain::new
.
fn layers(&self) -> u32
[src]
Returns the number of layers of the images of the swapchain.
See the documentation of Swapchain::new
.
fn transform(&self) -> SurfaceTransform
[src]
Returns the transform that was passed when creating the swapchain.
See the documentation of Swapchain::new
.
fn composite_alpha(&self) -> CompositeAlpha
[src]
Returns the alpha mode that was passed when creating the swapchain.
See the documentation of Swapchain::new
.
fn present_mode(&self) -> PresentMode
[src]
Returns the present mode that was passed when creating the swapchain.
See the documentation of Swapchain::new
.
fn clipped(&self) -> bool
[src]
Returns the value of clipped
that was passed when creating the swapchain.
See the documentation of Swapchain::new
.
Trait Implementations
impl VulkanObject for Swapchain
[src]
type Object = SwapchainKHR
The type of the object.
fn internal_object(&self) -> SwapchainKHR
[src]
Returns a reference to the object.
impl DeviceOwned for Swapchain
[src]
impl Debug for Swapchain
[src]
fn fmt(&self, fmt: &mut Formatter) -> Result<(), Error>
[src]
Formats the value using the given formatter.