WebGPU module

webgpu_canvas_size

procedure · 1 overloadwasmsince 0.28.0Source

Browser-only size of the page's canvas (the surface wgpuInstanceCreateSurface(instance, null) draws into), in pixels. It changes when the page resizes the canvas: compare it each frame and configure the surface again.

webgpu_canvas_size :: () -> (width: s32, height: s32)

Browser-only size of the page's canvas (the surface wgpuInstanceCreateSurface(instance, null) draws into), in pixels. It changes when the page resizes the canvas: compare it each frame and configure the surface again.

Returns

width: s32
height: s32

See also