UNPKG

nanogl-gltf

Version:
60 lines (59 loc) 1.6 kB
import KTXParser from "./KTXParser"; /** * This class is used to load compressed textures, and is Codec-specific (DXT, PVR, ETC) */ export declare class TextureCodec { /** * Parser used to parse the compressed texture */ parser: KTXParser; /** * Suffix of the compressed texture (ex: .dxt.ktx) */ suffix: string; /** * Is the texture compressed */ compressed: boolean; /** * Browser extension needed to load the texture (ex: WEBGL_compressed_texture_s3tc for DXT texture, or mozilla/webkit equivalent) */ ext: GLenum; constructor(parser: KTXParser, compressed: boolean, suffix: string, extension: number); /** * Transform the path of the texture to load to add the suffix * @param basePath Path of the texture to load */ transformPath: (basePath: string) => string; /** * Check if the browser supports the extension needed to load the texture */ isSupported(): boolean; } /** * Class used to load compressed KTX textures (DXT, PVR, ETC) */ export default class TextureLoader { /** * Codec for DXT textures */ DXTCodec: TextureCodec; /** * Codec for PVR textures */ PVRCodec: TextureCodec; /** * Codec for ETC textures */ ETCCodec: TextureCodec; constructor(); /** * Check if the browser supports any of the compressed texture formats */ hasCodec(): boolean; /** * Get the codec that is supported by the browser * Test order is DXT, then PVR, finally ETC */ getCodec(): TextureCodec; }