upload(data = this.data, offset = 0, dontBind = false)
    {
        // todo - needed?
        if (!dontBind) this.bind();

        const gl = this.gl;

        if (this.data.byteLength >= data.byteLength)
        {
            gl.bufferSubData(this.type, offset, data);
        }
        else
        {
            gl.bufferData(this.type, data, this.drawType);
        }

        this.data = data;
    }
/**
     * Uploads the buffer to the GPU
     *
     * @param {ArrayBuffer|SharedArrayBuffer|ArrayBufferView} data - an array of data to upload
     * @param {number} offset - if only a subset of the data should be uploaded, this is the amount of data to subtract
     * @param {boolean} dontBind - whether to bind the buffer before uploading it
     */
Uploads the buffer to the GPU
@param {ArrayBuffer|SharedArrayBuffer|ArrayBufferView} data - an array of data to upload
@param {number} offset - if only a subset of the data should be uploaded, this is the amount of data to subtract
@param {boolean} dontBind - whether to bind the buffer before uploading it
Uploads the buffer to the GPU @param { ArrayBuffer|SharedArrayBuffer|ArrayBufferView } data - an array of data to upload @param { number } offset - if only a subset of the data should be uploaded this is the amount of data to subtract @param { boolean } dontBind - whether to bind the buffer before uploading it
upload(data = this.data, offset = 0, dontBind = false)
    {
        if (!dontBind) this.bind();
        const gl = this.gl;
        if (this.data.byteLength >= data.byteLength)
        {
            gl.bufferSubData(this.type, offset, data);
        }
        else
        {
            gl.bufferData(this.type, data, this.drawType);
        }
        this.data = data;
    }
upload ( data = this . data , offset = 0 , dontBind = false ) { if ( ! dontBind ) this . bind ( ) ; const gl = this . gl ; if ( this . data . byteLength >= data . byteLength ) { gl . bufferSubData ( this . type , offset , data ) ; } else { gl . bufferData ( this . type , data , this . drawType ) ; } this . data = data ; }
Uploads the buffer to the GPU
 @param {ArrayBuffer|SharedArrayBuffer|ArrayBufferView} data - an array of data to upload
 @param {number} offset - if only a subset of the data should be uploaded, this is the amount of data to subtract
 @param {boolean} dontBind - whether to bind the buffer before uploading it
Uploads the buffer to the GPU @param { ArrayBuffer|SharedArrayBuffer|ArrayBufferView } data - an array of data to upload @param { number } offset - if only a subset of the data should be uploaded this is the amount of data to subtract @param { boolean } dontBind - whether to bind the buffer before uploading it
// todo - needed?