Struct wgpu::Surface[][src]

pub struct Surface { /* fields omitted */ }
Expand description

Handle to a presentable surface.

A Surface represents a platform-specific surface (e.g. a window) onto which rendered images may be presented. A Surface may be created with the unsafe function Instance::create_surface.

Implementations

Returns an optimal texture format to use for the Surface with this adapter.

Returns None if the surface is incompatible with the adapter.

Initializes Surface for presentation.

Panics

  • A old SurfaceFrame is still alive referencing an old surface.
  • Texture format requested is unsupported on the surface.

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

When the SurfaceFrame returned by this method is dropped, the swapchain will present the texture to the associated Surface.

If a SurfaceFrame referencing this surface is alive when the swapchain is recreated, recreating the swapchain will panic.

Trait Implementations

Formats the value using the given formatter. Read more

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.