Skip to content

Web Canvas: Allow initialization with HTMLCanvasElement and OffscreenCanvas #225

Description

@zubiden

As of version 1.0.0, the only way to initialize TVG.Canvas is to have a canvas with a unique ID (or selector path) in the DOM tree. This makes it impossible to use it within a WebWorker or to provide OffscreenCanvas.

This can be resolved by enabling initialization using a canvas element or an OffscreenCanvas instance.

For the time being, I think this limitation can be worked around by using a software renderer and receiving frames as an ArrayBuffer. I plan to explore this possibility and will send a pull request. Some slight architectural changes are required for WebGL and WebGPU.

If you would like this feature added, please leave a reaction or a comment explaining your needs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions