_destroyGlObjects(ctxRestore = false)
    {
        // destroy shaders
        if (!ctxRestore)
        {
            for (let i = 0; i < this.shaders.length; ++i)
            {
                if (this.shaders[i])
                {
                    this.shaders[i].destroy();
                }
            }
            this.shaders.length = 0;
        }

        // destroy vaos
        for (let i = 0; i < this.vaos.length; ++i)
        {
            this.vaos[i].destroy();
        }
        this.vaos.length = 0;

        // destroy vertex buffers
        for (let i = 0; i < this.vertexBuffers.length; ++i)
        {
            this.vertexBuffers[i].destroy();
        }
        this.vertexBuffers.length = 0;

        // destroy index buffer
        if (this.indexBuffer)
        {
            this.indexBuffer.destroy();
        }
        this.indexBuffer = null;
    }
/**
     * Destroys GL objects that can change between contexts.
     *
     * @private
     * @param {boolean} ctxRestore - Should we treat this like a context restore?
     */
Destroys GL objects that can change between contexts.
Destroys GL objects that can change between contexts .
_destroyGlObjects(ctxRestore = false)
    {
        if (!ctxRestore)
        {
            for (let i = 0; i < this.shaders.length; ++i)
            {
                if (this.shaders[i])
                {
                    this.shaders[i].destroy();
                }
            }
            this.shaders.length = 0;
        }
        for (let i = 0; i < this.vaos.length; ++i)
        {
            this.vaos[i].destroy();
        }
        this.vaos.length = 0;
        for (let i = 0; i < this.vertexBuffers.length; ++i)
        {
            this.vertexBuffers[i].destroy();
        }
        this.vertexBuffers.length = 0;
        if (this.indexBuffer)
        {
            this.indexBuffer.destroy();
        }
        this.indexBuffer = null;
    }
_destroyGlObjects ( ctxRestore = false ) { if ( ! ctxRestore ) { for ( let i = 0 ; i < this . shaders . length ; ++ i ) { if ( this . shaders [ i ] ) { this . shaders [ i ] . destroy ( ) ; } } this . shaders . length = 0 ; } for ( let i = 0 ; i < this . vaos . length ; ++ i ) { this . vaos [ i ] . destroy ( ) ; } this . vaos . length = 0 ; for ( let i = 0 ; i < this . vertexBuffers . length ; ++ i ) { this . vertexBuffers [ i ] . destroy ( ) ; } this . vertexBuffers . length = 0 ; if ( this . indexBuffer ) { this . indexBuffer . destroy ( ) ; } this . indexBuffer = null ; }
Destroys GL objects that can change between contexts.
Destroys GL objects that can change between contexts .
// destroy shaders // destroy vaos // destroy vertex buffers // destroy index buffer