src/program/opaque.js
/**
   * Use this program to draw.
   *
   * Sets up the proper culling for drawing opaque objects
   *
   * @param  {Function} fn The draw function
   * @return {void}
   */
Use this program to draw.
Sets up the proper culling for drawing opaque objects

@param  {Function} fn The draw function
@return {void}
Use this program to draw . Sets up the proper culling for drawing opaque objects @param { Function } fn The draw function @return { void }
use(fn) {
    if(!this.program)
    {
      this.init();
    }
    var gl = this._gl;
    gl.useProgram(this.program);
    gl.enable(gl.DEPTH_TEST);
    gl.enable(gl.CULL_FACE);
    gl.frontFace(gl.CCW);
    gl.cullFace(gl.BACK);
    gl.depthMask(true);
    fn(this.attributes, this.uniforms);
    resetGL(gl);
  }
use ( fn ) { if ( ! this . program ) { this . init ( ) ; } var gl = this . _gl ; gl . useProgram ( this . program ) ; gl . enable ( gl . DEPTH_TEST ) ; gl . enable ( gl . CULL_FACE ) ; gl . frontFace ( gl . CCW ) ; gl . cullFace ( gl . BACK ) ; gl . depthMask ( true ) ; fn ( this . attributes , this . uniforms ) ; resetGL ( gl ) ; }
Use this program to draw.
Use this program to draw .
// init stuffs. //gl.useProgram(0);