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§
Sourceunsafe fn delete_surface(self: Box<Self>)
unsafe fn delete_surface(self: Box<Self>)
Deletes the surface and associated resources.
The surface must not be in use when it is deleted.
Sourcefn surface_capabilities(&self, adapter: &Adapter) -> Option<SurfaceCapabilities>
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.
Sourceunsafe fn create_swapchain(
&self,
device: &Device,
config: &SurfaceConfiguration,
provided_old_swapchain: Option<Box<dyn Swapchain>>,
) -> Result<Box<dyn Swapchain>, SurfaceError>
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.