Table of Contents

Struct WebGPUSurfaceHost

Namespace
SixLabors.ImageSharp.Drawing.Processing.Backends
Assembly
SixLabors.ImageSharp.Drawing.WebGPU.dll

Describes the externally-owned native drawable that a WebGPUExternalSurface should attach to. Use the factory method that matches the host toolkit or platform that owns the drawable surface.

public readonly struct WebGPUSurfaceHost
Inherited Members

Remarks

Construct via the platform-specific factory methods. The caller retains ownership of the underlying handles; the external surface never releases them. GLFW and SDL handles are translated to their underlying platform source during surface creation. The remaining factories correspond directly to surface source descriptors accepted by the bundled wgpu-native API.

Methods

Android(nint)

Creates a host descriptor for an Android native window.

public static WebGPUSurfaceHost Android(nint aNativeWindow)

Parameters

aNativeWindow nint

The Android native window pointer (ANativeWindow*).

Returns

WebGPUSurfaceHost

An Android host descriptor.

Cocoa(nint)

Creates a host descriptor for a Cocoa window.

public static WebGPUSurfaceHost Cocoa(nint nsWindow)

Parameters

nsWindow nint

The Cocoa window pointer (NSWindow*).

Returns

WebGPUSurfaceHost

A Cocoa host descriptor.

Glfw(nint)

Creates a host descriptor for a GLFW-owned window.

public static WebGPUSurfaceHost Glfw(nint glfwWindow)

Parameters

glfwWindow nint

The GLFW window pointer (GLFWwindow*).

Returns

WebGPUSurfaceHost

A GLFW host descriptor.

MetalLayer(nint)

Creates a host descriptor for a Core Animation metal layer.

public static WebGPUSurfaceHost MetalLayer(nint metalLayer)

Parameters

metalLayer nint

The Core Animation metal layer pointer (CAMetalLayer*).

Returns

WebGPUSurfaceHost

A metal-layer host descriptor.

Remarks

The caller owns the layer and must keep it valid for the lifetime of the external surface.

Sdl(nint)

Creates a host descriptor for an SDL-owned window.

public static WebGPUSurfaceHost Sdl(nint sdlWindow)

Parameters

sdlWindow nint

The SDL window pointer (SDL_Window*).

Returns

WebGPUSurfaceHost

An SDL host descriptor.

SwapChainPanel(nint)

Creates a host descriptor for a WinUI swap-chain panel.

public static WebGPUSurfaceHost SwapChainPanel(nint panelNative)

Parameters

panelNative nint

The swap-chain panel's ISwapChainPanelNative* interface pointer.

Returns

WebGPUSurfaceHost

A swap-chain-panel host descriptor.

Remarks

The caller owns the interface pointer and must keep it valid for the lifetime of the external surface.

Wayland(nint, nint)

Creates a host descriptor for a Wayland surface.

public static WebGPUSurfaceHost Wayland(nint display, nint surface)

Parameters

display nint

The Wayland display pointer (wl_display*).

surface nint

The Wayland surface pointer (wl_surface*).

Returns

WebGPUSurfaceHost

A Wayland host descriptor.

Win32(nint, nint)

Creates a host descriptor for a Win32 window.

public static WebGPUSurfaceHost Win32(nint hwnd, nint hinstance)

Parameters

hwnd nint

The Win32 window handle (HWND).

hinstance nint

The module instance handle (HINSTANCE) associated with the window.

Returns

WebGPUSurfaceHost

A Win32 host descriptor.

X11(nint, nuint)

Creates a host descriptor for an X11 window.

public static WebGPUSurfaceHost X11(nint display, nuint window)

Parameters

display nint

The X11 display pointer (Display*).

window nuint

The X11 window identifier.

Returns

WebGPUSurfaceHost

An X11 host descriptor.