src/graphics/webgl-layer.js
function() {
        var gl = this.context;
        gl.useProgram(this.shader);
        gl.bindBuffer(gl.ARRAY_BUFFER, this._attributeBuffer);
        var a,
            attributes = this.attributes;
        // Process every attribute
        for (var i = 0; i < attributes.length; i++) {
            a = attributes[i];
            gl.vertexAttribPointer(
                a.location,
                a.width,
                a.type,
                false,
                this.stride * a.bytes,
                a.offset * a.bytes
            );
        }

        // For now, special case the need for texture objects
        var t = this.texture_obj;
        if (t && t.unit === null) {
            this.layer.texture_manager.bindTexture(t);
        }

        this.index_pointer = 0;
    }
function() {
        var gl = this.context;
        gl.useProgram(this.shader);
        gl.bindBuffer(gl.ARRAY_BUFFER, this._attributeBuffer);
        var a,
            attributes = this.attributes;
        // Process every attribute
        for (var i = 0; i < attributes.length; i++) {
            a = attributes[i];
            gl.vertexAttribPointer(
                a.location,
                a.width,
                a.type,
                false,
                this.stride * a.bytes,
                a.offset * a.bytes
            );
        }

        // For now, special case the need for texture objects
        var t = this.texture_obj;
        if (t && t.unit === null) {
            this.layer.texture_manager.bindTexture(t);
        }

        this.index_pointer = 0;
    }
function ( ) { var gl = this . context ; gl . useProgram ( this . shader ) ; gl . bindBuffer ( gl . ARRAY_BUFFER , this . _attributeBuffer ) ; var a , attributes = this . attributes ; // Process every attribute for ( var i = 0 ; i < attributes . length ; i ++ ) { a = attributes [ i ] ; gl . vertexAttribPointer ( a . location , a . width , a . type , false , this . stride * a . bytes , a . offset * a . bytes ) ; } // For now, special case the need for texture objects var t = this . texture_obj ; if ( t && t . unit === null ) { this . layer . texture_manager . bindTexture ( t ) ; } this . index_pointer = 0 ; }
Called before a batch of entities is prepped for rendering
Called before a batch of entities is prepped for rendering