loadTexture method

dynamic loadTexture(
  1. dynamic url,
  2. dynamic mapping,
  3. dynamic onLoad,
  4. dynamic onProgress,
  5. dynamic onError,
)

Implementation

loadTexture(url, mapping, onLoad, onProgress, onError) async {
  var manager = (this.manager != null) ? this.manager : defaultLoadingManager;
  var loader = manager.getHandler(url);

  loader ??= TextureLoader(manager);

  if (loader.setCrossOrigin != null) loader.setCrossOrigin(crossOrigin);

  // var texture = loader.load( url, onLoad, onProgress, onError );
  var texture = await loader.loadAsync(url, null);

  if (mapping != null) texture.mapping = mapping;

  return texture;
}