private static TextureFormat ExtractFormat(vts.Texture t)
    {
        switch (t.type)
        {
        case GpuType.Byte:
        case GpuType.UnsignedByte:
            switch (t.components)
            {
            case 1: return(TextureFormat.R8);

            case 2: return(TextureFormat.RG16);

            case 3: return(TextureFormat.RGB24);

            case 4: return(TextureFormat.RGBA32);
            }
            break;

        case GpuType.Short:
        case GpuType.UnsignedShort:
            switch (t.components)
            {
            case 1: return(TextureFormat.R16);
            }
            break;

        case GpuType.Float:
            switch (t.components)
            {
            case 1: return(TextureFormat.RFloat);

            case 2: return(TextureFormat.RGFloat);

            case 4: return(TextureFormat.RGBAFloat);
            }
            break;
        }
        throw new VtsException(-19, "Unsupported texture format");
    }
 public static System.Object LoadTexture(vts.Texture t)
 {
     return(new VtsTexture(t));
 }
 public VtsTexture(vts.Texture t)
 {
     id            = t.id;
     vt            = t;
     monochromatic = t.components == 1;
 }