texture.js
function( img ){
    var gl = this.gl;

    this.width  = img.width;
    this.height = img.height;

    gl.bindTexture( T2D, this.id );
    gl.texImage2D(  T2D, 0, this.internal, this.format, this.type, img );
  }
function( img ){
    var gl = this.gl;

    this.width  = img.width;
    this.height = img.height;

    gl.bindTexture( T2D, this.id );
    gl.texImage2D(  T2D, 0, this.internal, this.format, this.type, img );
  }
function ( img ) { var gl = this . gl ; this . width = img . width ; this . height = img . height ; gl . bindTexture ( T2D , this . id ) ; gl . texImage2D ( T2D , 0 , this . internal , this . format , this . type , img ) ; }
set texture data from html source
@param {TexImageSource} img the source. Can be ImageBitmap, ImageData, HTMLImageElement, HTMLCanvasElement, HTMLVideoElement
set texture data from html source