WebGPU Headers
The WebGPU C API
 
Loading...
Searching...
No Matches
WGPUSurface methods

Functions whose first argument has type WGPUSurface. More...

Functions

void wgpuSurfaceConfigure (WGPUSurface surface, WGPUSurfaceConfiguration const *config)
 
WGPUStatus wgpuSurfaceGetCapabilities (WGPUSurface surface, WGPUAdapter adapter, WGPUSurfaceCapabilities *capabilities)
 
void wgpuSurfaceGetCurrentTexture (WGPUSurface surface, WGPUSurfaceTexture *surfaceTexture)
 
WGPUStatus wgpuSurfacePresent (WGPUSurface surface)
 
void wgpuSurfaceSetLabel (WGPUSurface surface, WGPUStringView label)
 
void wgpuSurfaceUnconfigure (WGPUSurface surface)
 
void wgpuSurfaceAddRef (WGPUSurface surface)
 
void wgpuSurfaceRelease (WGPUSurface surface)
 

Detailed Description

Functions whose first argument has type WGPUSurface.

Function Documentation

◆ wgpuSurfaceConfigure()

void wgpuSurfaceConfigure ( WGPUSurface surface,
WGPUSurfaceConfiguration const * config )

Configures parameters for rendering to surface. Produces a Device Error for all content-timeline errors defined by the WebGPU specification.

See Surface Configuration for more details.

Parameters
configThe new configuration to use.

◆ wgpuSurfaceGetCapabilities()

WGPUStatus wgpuSurfaceGetCapabilities ( WGPUSurface surface,
WGPUAdapter adapter,
WGPUSurfaceCapabilities * capabilities )

Provides information on how adapter is able to use surface. See Querying Surface Capabilities for more details.

Parameters
adapterThe WGPUAdapter to get capabilities for presenting to this WGPUSurface.
capabilitiesThe structure to fill capabilities in. It may contain memory allocations so wgpuSurfaceCapabilitiesFreeMembers must be called to avoid memory leaks. This parameter is Returned with Ownership.
Returns
Indicates if there was an Out-Struct-Chain Error.

◆ wgpuSurfaceGetCurrentTexture()

void wgpuSurfaceGetCurrentTexture ( WGPUSurface surface,
WGPUSurfaceTexture * surfaceTexture )

Returns the WGPUTexture to render to surface this frame along with metadata on the frame. Returns NULL and WGPUSurfaceGetCurrentTextureStatus_Error if the surface is not configured.

See Presenting to Surface for more details.

Parameters
surfaceTextureThe structure to fill the WGPUTexture and metadata in.

◆ wgpuSurfacePresent()

WGPUStatus wgpuSurfacePresent ( WGPUSurface surface)

Shows surface's current texture to the user. See Presenting to Surface for more details.

Returns
Returns WGPUStatus_Error if the surface doesn't have a current texture.

◆ wgpuSurfaceSetLabel()

void wgpuSurfaceSetLabel ( WGPUSurface surface,
WGPUStringView label )

Modifies the label used to refer to surface.

Parameters
labelThe new label.

◆ wgpuSurfaceUnconfigure()

void wgpuSurfaceUnconfigure ( WGPUSurface surface)

Removes the configuration for surface. See Surface Configuration for more details.