defineRenderLayer
import { defineRenderLayer } from "@pibbl/core";defineRenderLayer() creates a Pibbl component from a
PibblRenderLayerDefinition
that owns one external
OffscreenCanvas lifecycle for each mounted component identity. Its callbacks
create resources, receive updates and size changes, render synchronously, and
dispose resources on unmount. The returned component accepts
PibblRenderLayerComponentProps
alongside its custom props.
API details from source
Section titled “API details from source”
Defines a Pibbl component backed by a persistent external-renderer surface and resource lifetime. Pibbl schedules frames and commits the bitmap and interaction snapshot together; the definition owns application-resource cleanup.
defineRenderLayer: <Props, Resources, Target extends object = object>(definition: PibblRenderLayerDefinition<Props, Resources, Target>) => PibblComponent<PibblRenderLayerProps<Props>>Related API: defineRenderLayer, PibblRenderLayerDefinition, PibblComponent, PibblRenderLayerProps.
Parameters
Section titled “Parameters”definition— Synchronous resource lifecycle, rendering, and interaction implementation. See PibblRenderLayerDefinition .
Returns
Section titled “Returns”A Pibbl component that owns one external-renderer boundary per mounted identity. See PibblComponent , PibblRenderLayerProps .
See also
Section titled “See also”View source — packages/core/src/lib/render-layer/define-render-layer.ts:42
Implementation guidance for agents
Section titled “Implementation guidance for agents”Read the External renderers and Three.js companion for ownership, adaptation, failure modes, and verification. Agent start provides the version-selection workflow.
Complete minimal examples
Section titled “Complete minimal examples”- Interactive bitmap layer: Draw a dot into an OffscreenCanvas and route clicks through Pibbl’s event boundary. Plain source
Interactive examples
Section titled “Interactive examples”Documentation version
Section titled “Documentation version”Documentation built with @pibbl/core 0.0.2, revision 272a94a. ALPHA — NOT FOR PRODUCTION USE.