[−][src]Struct vulkano::swapchain::Swapchain
Contains the swapping system and the images that can be shown on a surface.
Methods
impl<W> Swapchain<W>
[src]
pub fn new<F, S>(
device: Arc<Device>,
surface: Arc<Surface<W>>,
num_images: u32,
format: F,
dimensions: [u32; 2],
layers: u32,
usage: ImageUsage,
sharing: S,
transform: SurfaceTransform,
alpha: CompositeAlpha,
mode: PresentMode,
fullscreen_exclusive: FullscreenExclusive,
clipped: bool,
color_space: ColorSpace
) -> Result<(Arc<Swapchain<W>>, Vec<Arc<SwapchainImage<W>>>), SwapchainCreationError> where
F: FormatDesc,
S: Into<SharingMode>,
[src]
device: Arc<Device>,
surface: Arc<Surface<W>>,
num_images: u32,
format: F,
dimensions: [u32; 2],
layers: u32,
usage: ImageUsage,
sharing: S,
transform: SurfaceTransform,
alpha: CompositeAlpha,
mode: PresentMode,
fullscreen_exclusive: FullscreenExclusive,
clipped: bool,
color_space: ColorSpace
) -> Result<(Arc<Swapchain<W>>, Vec<Arc<SwapchainImage<W>>>), 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.
pub fn with_old_swapchain<F, S>(
device: Arc<Device>,
surface: Arc<Surface<W>>,
num_images: u32,
format: F,
dimensions: [u32; 2],
layers: u32,
usage: ImageUsage,
sharing: S,
transform: SurfaceTransform,
alpha: CompositeAlpha,
mode: PresentMode,
fullscreen_exclusive: FullscreenExclusive,
clipped: bool,
color_space: ColorSpace,
old_swapchain: Arc<Swapchain<W>>
) -> Result<(Arc<Swapchain<W>>, Vec<Arc<SwapchainImage<W>>>), SwapchainCreationError> where
F: FormatDesc,
S: Into<SharingMode>,
[src]
device: Arc<Device>,
surface: Arc<Surface<W>>,
num_images: u32,
format: F,
dimensions: [u32; 2],
layers: u32,
usage: ImageUsage,
sharing: S,
transform: SurfaceTransform,
alpha: CompositeAlpha,
mode: PresentMode,
fullscreen_exclusive: FullscreenExclusive,
clipped: bool,
color_space: ColorSpace,
old_swapchain: Arc<Swapchain<W>>
) -> Result<(Arc<Swapchain<W>>, Vec<Arc<SwapchainImage<W>>>), SwapchainCreationError> where
F: FormatDesc,
S: Into<SharingMode>,
Same as Swapchain::new but requires an old swapchain for the creation
pub fn recreate(
&self
) -> Result<(Arc<Swapchain<W>>, Vec<Arc<SwapchainImage<W>>>), SwapchainCreationError>
[src]
&self
) -> Result<(Arc<Swapchain<W>>, Vec<Arc<SwapchainImage<W>>>), SwapchainCreationError>
Recreates the swapchain with current dimensions of corresponding surface.
pub fn recreate_with_dimensions(
&self,
dimensions: [u32; 2]
) -> Result<(Arc<Swapchain<W>>, Vec<Arc<SwapchainImage<W>>>), SwapchainCreationError>
[src]
&self,
dimensions: [u32; 2]
) -> Result<(Arc<Swapchain<W>>, Vec<Arc<SwapchainImage<W>>>), SwapchainCreationError>
Recreates the swapchain with new dimensions.
pub fn surface(&self) -> &Arc<Surface<W>>
[src]
Returns the saved Surface, from the Swapchain creation
pub fn raw_image(&self, offset: usize) -> Option<ImageInner>
[src]
Returns of the images that belong to this swapchain.
pub fn num_images(&self) -> u32
[src]
Returns the number of images of the swapchain.
See the documentation of Swapchain::new
.
pub fn format(&self) -> Format
[src]
Returns the format of the images of the swapchain.
See the documentation of Swapchain::new
.
pub fn dimensions(&self) -> [u32; 2]
[src]
Returns the dimensions of the images of the swapchain.
See the documentation of Swapchain::new
.
pub fn layers(&self) -> u32
[src]
Returns the number of layers of the images of the swapchain.
See the documentation of Swapchain::new
.
pub fn transform(&self) -> SurfaceTransform
[src]
Returns the transform that was passed when creating the swapchain.
See the documentation of Swapchain::new
.
pub fn composite_alpha(&self) -> CompositeAlpha
[src]
Returns the alpha mode that was passed when creating the swapchain.
See the documentation of Swapchain::new
.
pub fn present_mode(&self) -> PresentMode
[src]
Returns the present mode that was passed when creating the swapchain.
See the documentation of Swapchain::new
.
pub fn clipped(&self) -> bool
[src]
Returns the value of clipped
that was passed when creating the swapchain.
See the documentation of Swapchain::new
.
pub fn fullscreen_exclusive(&self) -> FullscreenExclusive
[src]
Returns the value of 'fullscreen_exclusive` that was passed when creating the swapchain.
See the documentation of FullscreenExclusive
pub fn acquire_fullscreen_exclusive(
&self
) -> Result<(), FullscreenExclusiveError>
[src]
&self
) -> Result<(), FullscreenExclusiveError>
FullscreenExclusive::AppControlled
must be the active fullscreen exclusivity mode.
Acquire fullscreen exclusivity until either the release_fullscreen_exclusive
is
called, or if any of the the other Swapchain
functions return FullscreenExclusiveLost
.
Requires: FullscreenExclusive::AppControlled
pub fn release_fullscreen_exclusive(
&self
) -> Result<(), FullscreenExclusiveError>
[src]
&self
) -> Result<(), FullscreenExclusiveError>
FullscreenExclusive::AppControlled
must be the active fullscreen exclusivity mode.
Release fullscreen exclusivity.
pub fn is_fullscreen_exclusive(&self) -> bool
[src]
FullscreenExclusive::AppControlled
is not the active fullscreen exclusivity mode,
then this function will always return false. If true is returned the swapchain
is in FullscreenExclusive::AppControlled
fullscreen exclusivity mode and exclusivity
is currently acquired.
Trait Implementations
impl<W> Debug for Swapchain<W>
[src]
impl<W> DeviceOwned for Swapchain<W>
[src]
impl<W> Drop for Swapchain<W>
[src]
impl<W> VulkanObject for Swapchain<W>
[src]
type Object = SwapchainKHR
The type of the object.
const TYPE: ObjectType
[src]
fn internal_object(&self) -> SwapchainKHR
[src]
Auto Trait Implementations
impl<W> RefUnwindSafe for Swapchain<W> where
W: RefUnwindSafe,
W: RefUnwindSafe,
impl<W> Send for Swapchain<W> where
W: Send + Sync,
W: Send + Sync,
impl<W> Sync for Swapchain<W> where
W: Send + Sync,
W: Send + Sync,
impl<W> Unpin for Swapchain<W>
impl<W> UnwindSafe for Swapchain<W> where
W: RefUnwindSafe,
W: RefUnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Content for T
[src]
fn ref_from_ptr(*mut c_void, usize) -> Option<*mut T>
[src]
fn is_size_suitable(usize) -> bool
[src]
fn indiv_size() -> usize
[src]
impl<T> DeviceOwned for T where
T: Deref,
<T as Deref>::Target: DeviceOwned,
[src]
T: Deref,
<T as Deref>::Target: DeviceOwned,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,