@mocanvas/editor · interface
interface RenderBackendA GPU backend that can draw one engine frame. Implementations: WebGL2 (now), WebGPU (later).
Methods · 5
deleteTexture(id: number): voidRelease a texture. Batches still referencing id fall back to solid colour.
dispose(): voiddraw(frame: FrameBuffers, camera: CameraState, options: DrawOptions): voidDraw one frame. Batches are bound to the texture named by their texture word (0 = solid colour) and, when they carry a clip rect, scissored to it.
resize(width: number, height: number, dpr: number): voidResize the drawing buffer. Sizes are CSS pixels; dpr is the device pixel ratio.
uploadTexture(id: number, source: TextureSource, opts?: TextureOptions): voidCreate or replace the texture with host id id (must be non-zero; 0 is the
built-in solid texture). Shapes reference it through StyleWords.texture.
Properties · 1
readonly kind: "webgl2" | "webgpu"mocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.