@babylonjs/core
Version:
Getting started? Play directly with the Babylon.js API using our [playground](https://playground.babylonjs.com/). It also contains a lot of samples to learn how to use it.
35 lines • 1.29 kB
JavaScript
import { GetTGAHeader, UploadContent } from "../../../Misc/tga.js";
/**
* Implementation of the TGA Texture Loader.
* @internal
*/
// eslint-disable-next-line @typescript-eslint/naming-convention
export class _TGATextureLoader {
constructor() {
/**
* Defines whether the loader supports cascade loading the different faces.
*/
this.supportCascades = false;
}
/**
* Uploads the cube texture data to the WebGL texture. It has already been bound.
*/
loadCubeData() {
// eslint-disable-next-line no-throw-literal
throw ".env not supported in Cube.";
}
/**
* Uploads the 2D texture data to the WebGL texture. It has already been bound once in the callback.
* @param data contains the texture data
* @param texture defines the BabylonJS internal texture
* @param callback defines the method to call once ready to upload
*/
loadData(data, texture, callback) {
const bytes = new Uint8Array(data.buffer, data.byteOffset, data.byteLength);
const header = GetTGAHeader(bytes);
callback(header.width, header.height, texture.generateMipMaps, false, () => {
UploadContent(texture, bytes);
});
}
}
//# sourceMappingURL=tgaTextureLoader.js.map