Luxar Viewer API Documentation - v2026.9.22
    Preparing search index...

    Side-effects the recovery class needs from the host scene. Passed once at construction; the recovery class never reads SceneManager fields directly, only this surface.

    interface WebGLContextRecoveryDeps {
        canvas: HTMLCanvasElement;
        getScene(): Scene;
        renderer: WebGLRenderer;
        getPostProcessing(): PostProcessingManager | null;
        updateRendererSize(): void;
        onContextRestored(): void;
        triggerChange(): void;
        onContextLost?(): void;
    }
    Index
    canvas: HTMLCanvasElement
    renderer: WebGLRenderer
    • Lookup function — the SceneManager calls setupContextLossHandling() BEFORE setupScene(), so capturing this.scene at construction would close over undefined. The getter is invoked at restore time, by which point the scene is fully initialized.

      Returns Scene

    • Resize the renderer / DPR after restoration; identical to the SceneManager's updateRendererSize() private. Wired in via this callback rather than being re-implemented here because it touches SceneManager-only resize-debouncing state.

      Returns void

    • Notify subscribers (SceneLoader, NodeFactory, etc.) that the context has been restored. The SceneManager forwards this onto its own webgl-context-restored event — the recovery instance doesn't need to know about EventDispatcher subscribers itself.

      Returns void

    • Optional hook fired when the context is LOST. Used to shrink the adaptive GPU byte budget (context loss is a strong out-of-VRAM signal), so the post-restore scene holds less and doesn't lose the context again. Forwarded via a callback rather than importing the budget module here, keeping this concern dependency-free + testable.

      Returns void