B2G/gecko/browser/devtools/tilt/TiltGL.jsm
/**
   * Initializes a buffer of vertex indices, using an array of unsigned ints.
   * The item size will automatically default to 1, and the "numItems" will be
   * equal to the number of items in the array if not specified.
   *
   * @param {Array} aElementsArray
   *                an array of numbers (unsigned integers)
   * @param {Number} aNumItems
   *                 optional, how many items to use from the array
   */
Initializes a buffer of vertex indices, using an array of unsigned ints.
The item size will automatically default to 1, and the "numItems" will be
equal to the number of items in the array if not specified.

@param {Array} aElementsArray
an array of numbers (unsigned integers)
@param {Number} aNumItems
optional, how many items to use from the array
Initializes a buffer of vertex indices using an array of unsigned ints . The item size will automatically default to 1 and the " numItems " will be equal to the number of items in the array if not specified . @param { Array } aElementsArray an array of numbers ( unsigned integers ) @param { Number } aNumItems optional how many items to use from the array
function TGLIB_initBuffer(aElementsArray, aNumItems)
  {
    let gl = this._context;
    aNumItems = aNumItems || aElementsArray.length;
    this.components = new Uint16Array(aElementsArray);
    this._ref = gl.createBuffer();
    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this._ref);
    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.components, gl.STATIC_DRAW);
    this.itemSize = 1;
    this.numItems = aNumItems;
  }
function TGLIB_initBuffer ( aElementsArray , aNumItems ) { let gl = this . _context ; aNumItems = aNumItems || aElementsArray . length ; this . components = new Uint16Array ( aElementsArray ) ; this . _ref = gl . createBuffer ( ) ; gl . bindBuffer ( gl . ELEMENT_ARRAY_BUFFER , this . _ref ) ; gl . bufferData ( gl . ELEMENT_ARRAY_BUFFER , this . components , gl . STATIC_DRAW ) ; this . itemSize = 1 ; this . numItems = aNumItems ; }
Initializes a buffer of vertex indices, using an array of unsigned ints.
Initializes a buffer of vertex indices using an array of unsigned ints .
// the aNumItems parameter is optional, we can compute it if not specified // create the Uint16Array using the elements array // create an array buffer and bind the elements as a Uint16Array // remember some properties, useful when binding the buffer to a shader