Enode — API Reference
    Preparing search index...
    • Watch a canvas for a lost or restored WebGL context.

      Calling preventDefault on the loss event is what allows the browser to restore the context later; without it the loss is final.

      Parameters

      • canvas: HTMLCanvasElement

        the element three.js draws on.

      • onChange: (lost: boolean) => void

        called with true on loss and false on restoration.

      Returns () => void

      a function that stops watching.