destroy()
    {
        // unbind canvas events
        this.gl.canvas.removeEventListener('webglcontextlost', this._boundOnContextLost, false);
        this.gl.canvas.removeEventListener('webglcontextrestored', this._boundOnContextRestored, false);

        this._boundOnContextLost = null;
        this._boundOnContextRestored = null;

        // destroy state
        this.state.destroy();

        // detach and lose signals
        this.onContextLost.detachAll();
        this.onContextLost = null;

        this.onContextRestored.detachAll();
        this.onContextRestored = null;

        this.onContextChange.detachAll();
        this.onContextChange = null;

        this.onBeforeRender.detachAll();
        this.onBeforeRender = null;

        this.onAfterRender.detachAll();
        this.onAfterRender = null;

        this.activeObjectRenderer = null;

        // finally lose context
        if (this.gl.getExtension('WEBGL_lose_context'))
        {
            this.gl.getExtension('WEBGL_lose_context').loseContext();
        }

        this.gl = null;
    }
/**
     * Destroys this renderer and the related objects.
     *
     */
Destroys this renderer and the related objects.
Destroys this renderer and the related objects .
destroy()
    {
        this.gl.canvas.removeEventListener('webglcontextlost', this._boundOnContextLost, false);
        this.gl.canvas.removeEventListener('webglcontextrestored', this._boundOnContextRestored, false);
        this._boundOnContextLost = null;
        this._boundOnContextRestored = null;
        this.state.destroy();
        this.onContextLost.detachAll();
        this.onContextLost = null;
        this.onContextRestored.detachAll();
        this.onContextRestored = null;
        this.onContextChange.detachAll();
        this.onContextChange = null;
        this.onBeforeRender.detachAll();
        this.onBeforeRender = null;
        this.onAfterRender.detachAll();
        this.onAfterRender = null;
        this.activeObjectRenderer = null;
        if (this.gl.getExtension('WEBGL_lose_context'))
        {
            this.gl.getExtension('WEBGL_lose_context').loseContext();
        }
        this.gl = null;
    }
destroy ( ) { this . gl . canvas . removeEventListener ( 'webglcontextlost' , this . _boundOnContextLost , false ) ; this . gl . canvas . removeEventListener ( 'webglcontextrestored' , this . _boundOnContextRestored , false ) ; this . _boundOnContextLost = null ; this . _boundOnContextRestored = null ; this . state . destroy ( ) ; this . onContextLost . detachAll ( ) ; this . onContextLost = null ; this . onContextRestored . detachAll ( ) ; this . onContextRestored = null ; this . onContextChange . detachAll ( ) ; this . onContextChange = null ; this . onBeforeRender . detachAll ( ) ; this . onBeforeRender = null ; this . onAfterRender . detachAll ( ) ; this . onAfterRender = null ; this . activeObjectRenderer = null ; if ( this . gl . getExtension ( 'WEBGL_lose_context' ) ) { this . gl . getExtension ( 'WEBGL_lose_context' ) . loseContext ( ) ; } this . gl = null ; }
Destroys this renderer and the related objects.
Destroys this renderer and the related objects .
// unbind canvas events // destroy state // detach and lose signals // finally lose context