function TextureLoader(renderer) {
      var crossOrigin = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "anonymous";

      _classCallCheck(this, TextureLoader);

      this.type = "TextureLoader"; // we could pass our curtains object OR our curtains renderer object

      renderer = renderer && renderer.renderer || renderer; // throw warning if no renderer or webgl context

      if (!renderer || renderer.type !== "Renderer") {
        throwError(this.type + ": Renderer not passed as first argument", renderer);
      } else if (!renderer.gl) {
        throwError(this.type + ": Renderer WebGL context is undefined", renderer); // return if no gl context

        return;
      } // renderer and webgl context


      this.renderer = renderer;
      this.gl = this.renderer.gl; // crossorigin policy to apply

      this.crossOrigin = crossOrigin; // keep a track of all sources loaded via this loader

      this.elements = [];
    }
An asset loader that handles images, videos and canvas loading
   Load the assets and create a Texture class object that will use those assets as sources
     params:
   @renderer (Curtains or Renderer class object): our curtains object OR our curtains renderer object
   @crossOrigin (string, optional): crossorigin policy to use
     returns :
   @this: our TextureLoader element
*