B2G/gecko/browser/devtools/tilt/TiltGL.jsm
/**
   * Initializes buffer data to be used for drawing, using an array of floats.
   * The "aNumItems" param can be specified to use only a portion of the array.
   *
   * @param {Array} aElementsArray
   *                an array of floats
   * @param {Number} aItemSize
   *                 how many items create a block
   * @param {Number} aNumItems
   *                 optional, how many items to use from the array
   */
Initializes buffer data to be used for drawing, using an array of floats.
The "aNumItems" param can be specified to use only a portion of the array.

@param {Array} aElementsArray
an array of floats
@param {Number} aItemSize
how many items create a block
@param {Number} aNumItems
optional, how many items to use from the array
Initializes buffer data to be used for drawing using an array of floats . The " aNumItems " param can be specified to use only a portion of the array . @param { Array } aElementsArray an array of floats @param { Number } aItemSize how many items create a block @param { Number } aNumItems optional how many items to use from the array
function TGLVB_initBuffer(aElementsArray, aItemSize, aNumItems)
  {
    let gl = this._context;
    aNumItems = aNumItems || aElementsArray.length / aItemSize;
    this.components = new Float32Array(aElementsArray);
    this._ref = gl.createBuffer();
    gl.bindBuffer(gl.ARRAY_BUFFER, this._ref);
    gl.bufferData(gl.ARRAY_BUFFER, this.components, gl.STATIC_DRAW);
    this.itemSize = aItemSize;
    this.numItems = aNumItems;
  }
function TGLVB_initBuffer ( aElementsArray , aItemSize , aNumItems ) { let gl = this . _context ; aNumItems = aNumItems || aElementsArray . length / aItemSize ; this . components = new Float32Array ( aElementsArray ) ; this . _ref = gl . createBuffer ( ) ; gl . bindBuffer ( gl . ARRAY_BUFFER , this . _ref ) ; gl . bufferData ( gl . ARRAY_BUFFER , this . components , gl . STATIC_DRAW ) ; this . itemSize = aItemSize ; this . numItems = aNumItems ; }
Initializes buffer data to be used for drawing, using an array of floats.
Initializes buffer data to be used for drawing using an array of floats .
// the aNumItems parameter is optional, we can compute it if not specified // create the Float32Array using the elements array // create an array buffer and bind the elements as a Float32Array // remember some properties, useful when binding the buffer to a shader