pub fn build(&mut self, device: Device) -> VdResult<SwapchainKhr> {
        let image_format = self.create_info.image_format().clone();
        let extent = self.create_info.image_extent().clone();

        let handle = unsafe { device.create_swapchain_khr(&self.create_info, None)? };

        let images = unsafe {
            device.get_swapchain_images_khr(handle)?.iter().map(|&h| {
                Image::from_handle(device.clone(), h, true)
            }).collect()
        };

        Ok(SwapchainKhr {
            inner: Arc::new(Inner {
                handle,
                device,
                surface: self.surface.cloned()
                    .expect("unable to create swapchain: no surface specified"),
                images,
                image_format: image_format,
                extent,
            })
        })
    }
/// Builds and returns a new `SwapchainKhr`.
Builds and returns a new `SwapchainKhr`.
Builds and returns a new ` SwapchainKhr ` .
pub fn build(&mut self, device: Device) -> VdResult<SwapchainKhr> {
        let image_format = self.create_info.image_format().clone();
        let extent = self.create_info.image_extent().clone();
        let handle = unsafe { device.create_swapchain_khr(&self.create_info, None)? };
        let images = unsafe {
            device.get_swapchain_images_khr(handle)?.iter().map(|&h| {
                Image::from_handle(device.clone(), h, true)
            }).collect()
        };
        Ok(SwapchainKhr {
            inner: Arc::new(Inner {
                handle,
                device,
                surface: self.surface.cloned()
                    .expect("unable to create swapchain: no surface specified"),
                images,
                image_format: image_format,
                extent,
            })
        })
    }
pub fn build ( & mut self , device : Device ) -> VdResult < SwapchainKhr > { let image_format = self . create_info . image_format ( ) . clone ( ) ; let extent = self . create_info . image_extent ( ) . clone ( ) ; let handle = unsafe { device . create_swapchain_khr ( & self . create_info , None ) ? } ; let images = unsafe { device . get_swapchain_images_khr ( handle ) ? . iter ( ) . map ( | & h | { Image :: from_handle ( device . clone ( ) , h , true ) } ) . collect ( ) } ; Ok ( SwapchainKhr { inner : Arc :: new ( Inner { handle , device , surface : self . surface . cloned ( ) . expect ( " " ) , images , image_format : image_format , extent , } ) } ) }
Builds and returns a new `SwapchainKhr`.
Builds and returns a new ` SwapchainKhr ` .
&mut self
device
Device
&mut self
device
Device