Trait wgpu_hal::Surface

source ·
pub trait Surface<A: Api>: WasmNotSendSync {
    // Required methods
    unsafe fn configure(
        &self,
        device: &A::Device,
        config: &SurfaceConfiguration
    ) -> Result<(), SurfaceError>;
    unsafe fn unconfigure(&self, device: &A::Device);
    unsafe fn acquire_texture(
        &self,
        timeout: Option<Duration>
    ) -> Result<Option<AcquiredSurfaceTexture<A>>, SurfaceError>;
    unsafe fn discard_texture(&self, texture: A::SurfaceTexture);
}

Required Methods§

source

unsafe fn configure( &self, device: &A::Device, config: &SurfaceConfiguration ) -> Result<(), SurfaceError>

Configures the surface to use the given device.

Safety
source

unsafe fn unconfigure(&self, device: &A::Device)

Unconfigures the surface on the given device.

Safety
source

unsafe fn acquire_texture( &self, timeout: Option<Duration> ) -> Result<Option<AcquiredSurfaceTexture<A>>, SurfaceError>

Returns the next texture to be presented by the swapchain for drawing

A timeout of None means to wait indefinitely, with no timeout.

Portability

Some backends can’t support a timeout when acquiring a texture and the timeout will be ignored.

Returns None on timing out.

source

unsafe fn discard_texture(&self, texture: A::SurfaceTexture)

Implementors§