B2G/gecko/browser/devtools/tilt/TiltGL.jsm
/**
   * Sets texture parameters for the current texture binding.
   * Optionally, you can also (re)set the current texture binding manually.
   *
   * @param {Object} aContext
   *                 a WebGL context
   * @param {Object} aProperties
   *                 an object containing the texture properties
   */
Sets texture parameters for the current texture binding.
Optionally, you can also (re)set the current texture binding manually.

@param {Object} aContext
a WebGL context
@param {Object} aProperties
an object containing the texture properties
Sets texture parameters for the current texture binding . Optionally you can also ( re ) set the current texture binding manually . @param { Object } aContext a WebGL context @param { Object } aProperties an object containing the texture properties
function TGLTU_setTextureParams(aContext, aProperties)
  {
    aProperties = aProperties || {};
    let gl = aContext;
    let minFilter = gl.TEXTURE_MIN_FILTER;
    let magFilter = gl.TEXTURE_MAG_FILTER;
    let wrapS = gl.TEXTURE_WRAP_S;
    let wrapT = gl.TEXTURE_WRAP_T;
    if (aProperties.texture) {
      gl.bindTexture(gl.TEXTURE_2D, aProperties.texture.ref);
    }
    if ("nearest" === aProperties.minFilter) {
      gl.texParameteri(gl.TEXTURE_2D, minFilter, gl.NEAREST);
    } else if ("linear" === aProperties.minFilter && aProperties.mipmap) {
      gl.texParameteri(gl.TEXTURE_2D, minFilter, gl.LINEAR_MIPMAP_LINEAR);
    } else {
      gl.texParameteri(gl.TEXTURE_2D, minFilter, gl.LINEAR);
    }
    if ("nearest" === aProperties.magFilter) {
      gl.texParameteri(gl.TEXTURE_2D, magFilter, gl.NEAREST);
    } else {
      gl.texParameteri(gl.TEXTURE_2D, magFilter, gl.LINEAR);
    }
    if ("repeat" === aProperties.wrapS) {
      gl.texParameteri(gl.TEXTURE_2D, wrapS, gl.REPEAT);
    } else {
      gl.texParameteri(gl.TEXTURE_2D, wrapS, gl.CLAMP_TO_EDGE);
    }
    if ("repeat" === aProperties.wrapT) {
      gl.texParameteri(gl.TEXTURE_2D, wrapT, gl.REPEAT);
    } else {
      gl.texParameteri(gl.TEXTURE_2D, wrapT, gl.CLAMP_TO_EDGE);
    }
    if (aProperties.mipmap) {
      gl.generateMipmap(gl.TEXTURE_2D);
    }
  }
function TGLTU_setTextureParams ( aContext , aProperties ) { aProperties = aProperties || { } ; let gl = aContext ; let minFilter = gl . TEXTURE_MIN_FILTER ; let magFilter = gl . TEXTURE_MAG_FILTER ; let wrapS = gl . TEXTURE_WRAP_S ; let wrapT = gl . TEXTURE_WRAP_T ; if ( aProperties . texture ) { gl . bindTexture ( gl . TEXTURE_2D , aProperties . texture . ref ) ; } if ( "nearest" === aProperties . minFilter ) { gl . texParameteri ( gl . TEXTURE_2D , minFilter , gl . NEAREST ) ; } else if ( "linear" === aProperties . minFilter && aProperties . mipmap ) { gl . texParameteri ( gl . TEXTURE_2D , minFilter , gl . LINEAR_MIPMAP_LINEAR ) ; } else { gl . texParameteri ( gl . TEXTURE_2D , minFilter , gl . LINEAR ) ; } if ( "nearest" === aProperties . magFilter ) { gl . texParameteri ( gl . TEXTURE_2D , magFilter , gl . NEAREST ) ; } else { gl . texParameteri ( gl . TEXTURE_2D , magFilter , gl . LINEAR ) ; } if ( "repeat" === aProperties . wrapS ) { gl . texParameteri ( gl . TEXTURE_2D , wrapS , gl . REPEAT ) ; } else { gl . texParameteri ( gl . TEXTURE_2D , wrapS , gl . CLAMP_TO_EDGE ) ; } if ( "repeat" === aProperties . wrapT ) { gl . texParameteri ( gl . TEXTURE_2D , wrapT , gl . REPEAT ) ; } else { gl . texParameteri ( gl . TEXTURE_2D , wrapT , gl . CLAMP_TO_EDGE ) ; } if ( aProperties . mipmap ) { gl . generateMipmap ( gl . TEXTURE_2D ) ; } }
Sets texture parameters for the current texture binding.
Sets texture parameters for the current texture binding .
// make sure the properties argument is an object // bind a new texture if necessary // set the minification filter // set the magnification filter // set the wrapping on the x-axis for the texture // set the wrapping on the y-axis for the texture // generate mipmap if necessary