Trait wgpu_hal::Surface

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

Required Methods§

source

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

source

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

source

unsafe fn acquire_texture( &mut 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(&mut self, texture: A::SurfaceTexture)

Implementors§