engine.dynamicTexture.d.ts 1.7 KB

123456789101112131415161718192021222324252627
  1. import { InternalTexture } from "../../Materials/Textures/internalTexture";
  2. import type { ImageSource, Nullable } from "../../types";
  3. import type { ICanvas } from "../ICanvas";
  4. declare module "../../Engines/thinEngine" {
  5. interface ThinEngine {
  6. /**
  7. * Creates a dynamic texture
  8. * @param width defines the width of the texture
  9. * @param height defines the height of the texture
  10. * @param generateMipMaps defines if the engine should generate the mip levels
  11. * @param samplingMode defines the required sampling mode (Texture.NEAREST_SAMPLINGMODE by default)
  12. * @returns the dynamic texture inside an InternalTexture
  13. */
  14. createDynamicTexture(width: number, height: number, generateMipMaps: boolean, samplingMode: number): InternalTexture;
  15. /**
  16. * Update the content of a dynamic texture
  17. * @param texture defines the texture to update
  18. * @param source defines the source containing the data
  19. * @param invertY defines if data must be stored with Y axis inverted
  20. * @param premulAlpha defines if alpha is stored as premultiplied
  21. * @param format defines the format of the data
  22. * @param forceBindTexture if the texture should be forced to be bound eg. after a graphics context loss (Default: false)
  23. * @param allowGPUOptimization true to allow some specific GPU optimizations (subject to engine feature "allowGPUOptimizationsForGUI" being true)
  24. */
  25. updateDynamicTexture(texture: Nullable<InternalTexture>, source: ImageSource | ICanvas, invertY?: boolean, premulAlpha?: boolean, format?: number, forceBindTexture?: boolean, allowGPUOptimization?: boolean): void;
  26. }
  27. }