pub fn build(&self, instance: Instance) -> VdResult<SurfaceKhr> {
        let handle = unsafe {
            match self.create_info {
                CreateInfo::Xlib(ref ci) => instance.create_xlib_surface_khr(ci, None)?,
                CreateInfo::Xcb(ref ci) => instance.create_xcb_surface_khr(ci, None)?,
                CreateInfo::Wayland(ref ci) => instance.create_wayland_surface_khr(ci, None)?,
                CreateInfo::Mir(ref ci) => instance.create_mir_surface_khr(ci, None)?,
                CreateInfo::Win32(ref ci) => instance.create_win32_surface_khr(ci, None)?,
                CreateInfo::Android(ref ci) => instance.create_android_surface_khr(ci, None)?,
                CreateInfo::Ios(ref ci) => instance.create_ios_surface_mvk(ci, None)?,
                CreateInfo::MacOs(ref ci) => instance.create_mac_os_surface_mvk(ci, None)?,
                CreateInfo::Vi(ref ci) => instance.create_vi_surface_nn(ci, None)?,
                CreateInfo::None => panic!("no surface window information provided"),
            }
        };

        Ok(SurfaceKhr {
            inner: Arc::new(Inner {
                handle,
                instance: instance,
                active: AtomicBool::new(false),
            })
        })
    }
/// Builds and returns a new `SurfaceKhr`.
Builds and returns a new `SurfaceKhr`.
Builds and returns a new ` SurfaceKhr ` .
pub fn build(&self, instance: Instance) -> VdResult<SurfaceKhr> {
        let handle = unsafe {
            match self.create_info {
                CreateInfo::Xlib(ref ci) => instance.create_xlib_surface_khr(ci, None)?,
                CreateInfo::Xcb(ref ci) => instance.create_xcb_surface_khr(ci, None)?,
                CreateInfo::Wayland(ref ci) => instance.create_wayland_surface_khr(ci, None)?,
                CreateInfo::Mir(ref ci) => instance.create_mir_surface_khr(ci, None)?,
                CreateInfo::Win32(ref ci) => instance.create_win32_surface_khr(ci, None)?,
                CreateInfo::Android(ref ci) => instance.create_android_surface_khr(ci, None)?,
                CreateInfo::Ios(ref ci) => instance.create_ios_surface_mvk(ci, None)?,
                CreateInfo::MacOs(ref ci) => instance.create_mac_os_surface_mvk(ci, None)?,
                CreateInfo::Vi(ref ci) => instance.create_vi_surface_nn(ci, None)?,
                CreateInfo::None => panic!("no surface window information provided"),
            }
        };
        Ok(SurfaceKhr {
            inner: Arc::new(Inner {
                handle,
                instance: instance,
                active: AtomicBool::new(false),
            })
        })
    }
pub fn build ( & self , instance : Instance ) -> VdResult < SurfaceKhr > { let handle = unsafe { match self . create_info { CreateInfo :: Xlib ( ref ci ) => instance . create_xlib_surface_khr ( ci , None ) ? , CreateInfo :: Xcb ( ref ci ) => instance . create_xcb_surface_khr ( ci , None ) ? , CreateInfo :: Wayland ( ref ci ) => instance . create_wayland_surface_khr ( ci , None ) ? , CreateInfo :: Mir ( ref ci ) => instance . create_mir_surface_khr ( ci , None ) ? , CreateInfo :: Win32 ( ref ci ) => instance . create_win32_surface_khr ( ci , None ) ? , CreateInfo :: Android ( ref ci ) => instance . create_android_surface_khr ( ci , None ) ? , CreateInfo :: Ios ( ref ci ) => instance . create_ios_surface_mvk ( ci , None ) ? , CreateInfo :: MacOs ( ref ci ) => instance . create_mac_os_surface_mvk ( ci , None ) ? , CreateInfo :: Vi ( ref ci ) => instance . create_vi_surface_nn ( ci , None ) ? , CreateInfo :: None => panic ! ( " " ) , } } ; Ok ( SurfaceKhr { inner : Arc :: new ( Inner { handle , instance : instance , active : AtomicBool :: new ( false ) , } ) } ) }
Builds and returns a new `SurfaceKhr`.
Builds and returns a new ` SurfaceKhr ` .
&self
instance
Instance
&self
instance
Instance