Skip to content

CanvasTexture

Defined in: asset/canvasTexture.ts:32

A texture backed by a canvas someone else draws on.

readonly handle: number

Defined in: asset/canvasTexture.ts:34

The engine texture handle — stable across every update.


readonly height: number

Defined in: asset/canvasTexture.ts:37


readonly width: number

Defined in: asset/canvasTexture.ts:36

Size of the last upload. Follows the source when it is resized.

destroy(): void

Defined in: asset/canvasTexture.ts:42

End it: the device frees the texture and the handle is dead afterwards.

void


update(): void

Defined in: asset/canvasTexture.ts:40

Re-take the source’s current content. Cheap to call, not free: one texImage2D of the whole surface. Callers gate on visibility.

void