internalTextureLoader.d.ts 2.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. import type { Nullable } from "../../types";
  2. import type { InternalTexture } from "../../Materials/Textures/internalTexture";
  3. /**
  4. * This represents the required contract to create a new type of texture loader.
  5. */
  6. export interface IInternalTextureLoader {
  7. /**
  8. * Defines whether the loader supports cascade loading the different faces.
  9. */
  10. supportCascades: boolean;
  11. /**
  12. * This returns if the loader support the current file information.
  13. * @param extension defines the file extension of the file being loaded
  14. * @param mimeType defines the optional mime type of the file being loaded
  15. * @returns true if the loader can load the specified file
  16. */
  17. canLoad(extension: string, mimeType?: string): boolean;
  18. /**
  19. * Uploads the cube texture data to the WebGL texture. It has already been bound.
  20. * @param data contains the texture data
  21. * @param texture defines the BabylonJS internal texture
  22. * @param createPolynomials will be true if polynomials have been requested
  23. * @param onLoad defines the callback to trigger once the texture is ready
  24. * @param onError defines the callback to trigger in case of error
  25. * @param options options to be passed to the loader
  26. */
  27. loadCubeData(data: ArrayBufferView | ArrayBufferView[], texture: InternalTexture, createPolynomials: boolean, onLoad: Nullable<(data?: any) => void>, onError: Nullable<(message?: string, exception?: any) => void>, options?: any): void;
  28. /**
  29. * Uploads the 2D texture data to the WebGL texture. It has already been bound once in the callback.
  30. * @param data contains the texture data
  31. * @param texture defines the BabylonJS internal texture
  32. * @param callback defines the method to call once ready to upload
  33. * @param options options to be passed to the loader
  34. */
  35. loadData(data: ArrayBufferView, texture: InternalTexture, callback: (width: number, height: number, loadMipmap: boolean, isCompressed: boolean, done: () => void, loadFailed?: boolean) => void, options?: any): void;
  36. }