Trait wgpu::hal::Surface

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

Required Methods§

source

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

Configures the surface to use the given device.

Safety
source

unsafe fn unconfigure(&self, device: &<A as Api>::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 as Api>::SurfaceTexture)

Implementors§