Struct SwapchainBuilder

Source
pub struct SwapchainBuilder<'n, Surface: Surface>(/* private fields */);
Expand description

Builder object to construct a Swapchain, backed with a surface

Implementations§

Source§

impl<'n, Surface: Surface> SwapchainBuilder<'n, Surface>

Source

pub fn new( surface: Surface, min_image_count: u32, format: VkSurfaceFormatKHR, extent: VkExtent2D, usage: ImageUsageFlags, ) -> Self

Source

pub const fn with_next(self, next: &'n (impl VulkanStructure + ?Sized)) -> Self

Source

pub const fn array_layers(self, layers: u32) -> Self

Source

pub const fn shared(self, queue_families: &[u32]) -> Self

Source

pub const fn exclusive(self) -> Self

Source

pub const fn pre_transform(self, tf: VkSurfaceTransformFlagsKHR) -> Self

Default: Inherit

Source

pub const fn composite_alpha(self, a: VkCompositeAlphaFlagsKHR) -> Self

Default: Inherit

Source

pub const fn present_mode(self, mode: PresentMode) -> Self

Default: FIFO

Source

pub const fn enable_clip(self) -> Self

Enables whether the Vulkan implementation is allowed to discard rendering operations that affect regions of the surface which aren’t visible

Source

pub fn create<Device: Device>( self, device: Device, ) -> Result<SurfaceSwapchainObject<Device, Surface>>

Available on crate feature Implements only.

Create a swapchain

§Failures

On failure, this command returns

  • VK_ERROR_OUT_OF_HOST_MEMORY
  • VK_ERROR_OUT_OF_DEVICE_MEMORY
  • VK_ERROR_DEVICE_LOST
  • VK_ERROR_SURFACE_LOST_KHR
  • VK_ERROR_NATIVE_WINDOW_IN_USE_KHR

Trait Implementations§

Auto Trait Implementations§

§

impl<'n, Surface> Freeze for SwapchainBuilder<'n, Surface>
where Surface: Freeze,

§

impl<'n, Surface> !RefUnwindSafe for SwapchainBuilder<'n, Surface>

§

impl<'n, Surface> !Send for SwapchainBuilder<'n, Surface>

§

impl<'n, Surface> !Sync for SwapchainBuilder<'n, Surface>

§

impl<'n, Surface> Unpin for SwapchainBuilder<'n, Surface>
where Surface: Unpin,

§

impl<'n, Surface> !UnwindSafe for SwapchainBuilder<'n, Surface>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.