Struct Surface

A handle to a presentable surface.

struct Surface ;

A Surface represents a platform-specific surface (e.g. a window) to which rendered images may be presented.

A Surface may be created with Surface.fromMetalLayer, Surface.fromWindowsHwnd, or Surface.fromXlib.

Fields

NameTypeDescription
id __C.WGPUSurfaceImpl*Handle identifier.

Methods

NameDescription
fromMetalLayer (instance, layer, label) Create a new Surface from a Metal layer.
fromWindowsHwnd (instance, _hinstance, hwnd, label) Create a new Surface from a Windows window handle.
fromXlib (instance, display, window, label) Create a new Surface from a Xlib window handle.
preferredFormat (adapter) Retreive an optimal texture format for this Surface.

See Also

wgpu::Surface