program.js
function( vert, frag, prefix ){
    this.ready   = false;

    prefix = ( prefix === undefined ) ? '' : prefix+'\n';

    var gl = this.gl;

    if( !( compileShader( gl, this.fShader, prefix + frag ) &&
           compileShader( gl, this.vShader, prefix + vert ) ) ) {
      return false;
    }

    gl.linkProgram(this.program);

    if ( Program.debug && !gl.getProgramParameter(this.program, gl.LINK_STATUS)) {
      warn(gl.getProgramInfoLog(this.program));
      return false;
    }

    // delete old accessors
    while (this.dyns.length>0) {
      delete this[this.dyns.pop()];
    }

    this._cuid   = (_UID++)|0; 

    return true;
  }
function( vert, frag, prefix ){
    this.ready   = false;

    prefix = ( prefix === undefined ) ? '' : prefix+'\n';

    var gl = this.gl;

    if( !( compileShader( gl, this.fShader, prefix + frag ) &&
           compileShader( gl, this.vShader, prefix + vert ) ) ) {
      return false;
    }

    gl.linkProgram(this.program);

    if ( Program.debug && !gl.getProgramParameter(this.program, gl.LINK_STATUS)) {
      warn(gl.getProgramInfoLog(this.program));
      return false;
    }

    // delete old accessors
    while (this.dyns.length>0) {
      delete this[this.dyns.pop()];
    }

    this._cuid   = (_UID++)|0; 

    return true;
  }
function ( vert , frag , prefix ) { this . ready = false ; prefix = ( prefix === undefined ) ? '' : prefix + '\n' ; var gl = this . gl ; if ( ! ( compileShader ( gl , this . fShader , prefix + frag ) && compileShader ( gl , this . vShader , prefix + vert ) ) ) { return false ; } gl . linkProgram ( this . program ) ; if ( Program . debug && ! gl . getProgramParameter ( this . program , gl . LINK_STATUS ) ) { warn ( gl . getProgramInfoLog ( this . program ) ) ; return false ; } // delete old accessors while ( this . dyns . length > 0 ) { delete this [ this . dyns . pop ( ) ] ; } this . _cuid = ( _UID ++ ) | 0 ; return true ; }
Compile vertex and fragment shader then link gl program
This method can be safely called several times.
@param {String} vert vertex shader code
@param {String} frag fragment shader code
@param {String} [prefix=''] an optional string append to both fragment and vertex code
Compile vertex and fragment shader then link gl program This method can be safely called several times .