load method

  1. @override
dynamic load(
  1. dynamic url,
  2. Function onLoad, [
  3. Function? onProgress,
  4. Function? onError,
])
override

Implementation

@override
load(url, onLoad, [onProgress, onError]) {
  onLoadCallback(texture, texData) {
    switch (texture.type) {
      case UnsignedByteType:
        texture.encoding = RGBEEncoding;
        texture.minFilter = NearestFilter;
        texture.magFilter = NearestFilter;
        texture.generateMipmaps = false;
        texture.flipY = true;
        break;

      case FloatType:
        texture.encoding = LinearEncoding;
        texture.minFilter = LinearFilter;
        texture.magFilter = LinearFilter;
        texture.generateMipmaps = false;
        texture.flipY = true;
        break;

      case HalfFloatType:
        texture.encoding = LinearEncoding;
        texture.minFilter = LinearFilter;
        texture.magFilter = LinearFilter;
        texture.generateMipmaps = false;
        texture.flipY = true;
        break;
    }

    onLoad(texture);
  }

  return super.load(url, onLoadCallback, onProgress, onError);
}