Skip to content

@modoki/engine / index / registerRenderSurface

Function: registerRenderSurface()

registerRenderSurface(getWorld, state): () => void

Publish a render surface (its RenderState + a getter for the world it draws). Pass getCurrentWorld — the surface follows scene swaps. Call on renderer mount; call the returned disposer on unmount. Each registration is a distinct handle, so two surfaces on one world coexist.

Parameters

getWorld

() => World

state

RenderState

Returns

() => void

Built with Modoki.