Java 类com.badlogic.gdx.graphics.glutils.KTXTextureData 实例源码

项目:libgdxcn    文件:CubemapLoader.java   
@Override
public void loadAsync (AssetManager manager, String fileName, FileHandle file, CubemapParameter parameter) {
    info.filename = fileName;
    if (parameter == null || parameter.cubemapData == null) {
        Pixmap pixmap = null;
        Format format = null;
        boolean genMipMaps = false;
        info.cubemap = null;

        if (parameter != null) {
            format = parameter.format;
            info.cubemap = parameter.cubemap;
        }

        if (fileName.contains(".ktx") || fileName.contains(".zktx")) {
            info.data = new KTXTextureData(file, genMipMaps);
        }
    } else {
        info.data = parameter.cubemapData;
        info.cubemap = parameter.cubemap;
    }
    if (!info.data.isPrepared()) info.data.prepare();
}
项目:libgdxcn    文件:TextureData.java   
public static TextureData loadFromFile (FileHandle file, Format format, boolean useMipMaps) {
    if (file == null) return null;
    if (file.name().endsWith(".cim")) return new FileTextureData(file, PixmapIO.readCIM(file), format, useMipMaps);
    if (file.name().endsWith(".etc1")) return new ETC1TextureData(file, useMipMaps);
    if (file.name().endsWith(".ktx") || file.name().endsWith(".zktx")) return new KTXTextureData(file, useMipMaps);
    return new FileTextureData(file, new Pixmap(file), format, useMipMaps);
}
项目:nvlist    文件:PremultTextureLoader.java   
protected TextureData loadTexData(FileHandle file, Format format, boolean genMipMaps) {
    if (file.name().endsWith(".ktx") || file.name().endsWith(".zktx")) {
        return new KTXTextureData(file, genMipMaps);
    }
    return new PremultFileTextureData(file, format, genMipMaps);
}