Documentation
    Preparing search index...

    Interface WebglCanvas

    The drawing surface, described by what this backend actually touches (§61's RendererOptions.canvas is unknown precisely so each backend can narrow it here).

    HTMLCanvasElement and OffscreenCanvas-plus-an-event-target both satisfy this structurally. The narrowing is done at runtime by WebglRenderer.initialize, which is why the interface exists as a target for a checked cast rather than as a parameter type.

    interface WebglCanvas {
        height: number;
        width: number;
        addEventListener(
            type: string,
            listener: (event: WebglContextEventLike) => void,
        ): void;
        getContext(
            contextId: "webgl2",
            attributes?: WebglContextAttributes,
        ): unknown;
        removeEventListener(
            type: string,
            listener: (event: WebglContextEventLike) => void,
        ): void;
    }
    Index
    height: number

    Drawing-buffer height in device pixels. Written by resize.

    width: number

    Drawing-buffer width in device pixels. Written by resize.

    • Parameters

      Returns void

    • Acquires a rendering context. Typed to return unknown because this package does not name WebGL2RenderingContext; the result is validated structurally before use.

      Parameters

      Returns unknown

    • Parameters

      Returns void