src/graphics/gl-textures.js
function(url, image, repeating) {
        // gl is the context, webgl is the Crafty object containing prefs/etc
        // var gl = this.gl;
        var webgl = this.webgl;

        // Check whether a texture that matches the one requested already exists
        var id = "texture-(r:" + repeating + ")-" + url;
        if (typeof this.registered_textures[id] !== "undefined")
            return this.registered_textures[id];

        // Create a texture, bind it to the next available unit
        var t = new TextureWrapper(this, id);
        this.registered_textures[id] = t;
        this.bindTexture(t);

        // Set the properties of the texture
        t.setImage(image);
        t.setFilter(webgl.texture_filter);
        t.setRepeat(repeating);

        return t;
    }
function(url, image, repeating) {
        // gl is the context, webgl is the Crafty object containing prefs/etc
        // var gl = this.gl;
        var webgl = this.webgl;

        // Check whether a texture that matches the one requested already exists
        var id = "texture-(r:" + repeating + ")-" + url;
        if (typeof this.registered_textures[id] !== "undefined")
            return this.registered_textures[id];

        // Create a texture, bind it to the next available unit
        var t = new TextureWrapper(this, id);
        this.registered_textures[id] = t;
        this.bindTexture(t);

        // Set the properties of the texture
        t.setImage(image);
        t.setFilter(webgl.texture_filter);
        t.setRepeat(repeating);

        return t;
    }
function ( url , image , repeating ) { // gl is the context, webgl is the Crafty object containing prefs/etc // var gl = this.gl; var webgl = this . webgl ; // Check whether a texture that matches the one requested already exists var id = "texture-(r:" + repeating + ")-" + url ; if ( typeof this . registered_textures [ id ] !== "undefined" ) return this . registered_textures [ id ] ; // Create a texture, bind it to the next available unit var t = new TextureWrapper ( this , id ) ; this . registered_textures [ id ] = t ; this . bindTexture ( t ) ; // Set the properties of the texture t . setImage ( image ) ; t . setFilter ( webgl . texture_filter ) ; t . setRepeat ( repeating ) ; return t ; }
creates a texture out of the given image and repeating state The url is just used to generate a unique id for the texture
creates a texture out of the given image and repeating state The url is just used to generate a unique id for the texture