Interface: Presentation<TCanvas>

A configured WebGPU canvas binding.

Type Parameters

Type Parameter

Default type

TCanvas extends PresentationCanvas

PresentationCanvas

Properties

Property

Modifier

Type

Description

canvas

readonly

TCanvas

Borrowed canvas configured by this presentation binding.

context

readonly

GPUCanvasContext

Configured context borrowed from the canvas.

device

readonly

GPUDevice

Borrowed device used to configure the canvas.

format

readonly

GPUTextureFormat

Texture format used by the presentation context.

Methods

destroy()

destroy(): void

Unconfigures the context and restores the canvas’s original backing size.

Returns

void


resize()

resize(width, height): boolean

Sets the canvas backing size in device pixels, fitting it within the device’s 2D texture limit when necessary.

Parameters

Parameter

Type

width

number

height

number

Returns

boolean

true when the backing size changed.