hxn

Instance

A WebGPU instance: navigator.gpu.

Static methods

function hxnAdopt(hxnRaw:Handle):Instance

An object for a value the library returned.

function create():Instance

Properties

var hxnRaw:Handle

Methods

function requestAdapter():Future<Adapter>

The browser's adapter, its default for power preference.

function claimCanvas():Future<Unit>

Takes the web page's canvas for this program's WebGPU, which createCanvasSurface then renders into. It fails when the page has no canvas or another browser agent holds it. Without threads the program holds the canvas, and it settles at once.

function createCanvasSurface():Surface

The web page's canvas, as a surface to render frames into.

function close():Void

Releases the native value now. The collector does it otherwise. Using this object afterwards throws.