Trait Surface

Source
pub(super) trait Surface:
    Send
    + Sync
    + 'static {
    // Required methods
    unsafe fn delete_surface(self: Box<Self>);
    fn surface_capabilities(
        &self,
        adapter: &Adapter,
    ) -> Option<SurfaceCapabilities>;
    unsafe fn create_swapchain(
        &self,
        device: &Device,
        config: &SurfaceConfiguration,
        provided_old_swapchain: Option<Box<dyn Swapchain>>,
    ) -> Result<Box<dyn Swapchain>, SurfaceError>;
    fn as_any(&self) -> &dyn Any;
}

Required Methods§

Source

unsafe fn delete_surface(self: Box<Self>)

Deletes the surface and associated resources.

The surface must not be in use when it is deleted.

Source

fn surface_capabilities(&self, adapter: &Adapter) -> Option<SurfaceCapabilities>

Returns the surface capabilities for the given adapter.

Returns None if the surface is not compatible with the adapter.

Source

unsafe fn create_swapchain( &self, device: &Device, config: &SurfaceConfiguration, provided_old_swapchain: Option<Box<dyn Swapchain>>, ) -> Result<Box<dyn Swapchain>, SurfaceError>

Creates a swapchain for the surface with the given configuration.

If this is not the first swapchain created for the surface, the old swapchain must be provided. Swapchain::release_resources must be called on the old swapchain before calling this method.

Source

fn as_any(&self) -> &dyn Any

Allows downcasting to the concrete type.

Implementors§