internalTextureLoader.ts 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. import { Nullable } from "../../types";
  2. import { 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 wether 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. * @returns true if the loader can load the specified file
  15. */
  16. canLoad(extension: string): boolean;
  17. /**
  18. * Uploads the cube texture data to the WebGL texture. It has already been bound.
  19. * @param data contains the texture data
  20. * @param texture defines the BabylonJS internal texture
  21. * @param createPolynomials will be true if polynomials have been requested
  22. * @param onLoad defines the callback to trigger once the texture is ready
  23. * @param onError defines the callback to trigger in case of error
  24. */
  25. loadCubeData(data: ArrayBufferView | ArrayBufferView[], texture: InternalTexture, createPolynomials: boolean, onLoad: Nullable<(data?: any) => void>, onError: Nullable<(message?: string, exception?: any) => void>): void;
  26. /**
  27. * Uploads the 2D texture data to the WebGL texture. It has already been bound once in the callback.
  28. * @param data contains the texture data
  29. * @param texture defines the BabylonJS internal texture
  30. * @param callback defines the method to call once ready to upload
  31. */
  32. loadData(data: ArrayBufferView, texture: InternalTexture, callback: (width: number, height: number, loadMipmap: boolean, isCompressed: boolean, done: () => void, loadFailed?: boolean) => void): void;
  33. }