public void ReadFromStream(Stream stream) { BinaryReader br = new BinaryReader(stream); Magic = br.ReadBigUInt32(); Unknown1 = br.ReadByte(); Unknown2 = br.ReadByte(); Format = (GtexPixelFromat)br.ReadByte(); MipMapCount = br.ReadByte(); Unknown3 = br.ReadByte(); IsCubeMap = br.ReadByte() == 1; Width = br.ReadBigInt16(); Height = br.ReadBigInt16(); Depth = br.ReadBigInt16(); LinerSize = br.ReadBigInt32(); DataOffset = br.ReadBigInt32(); }
private static Format GetDxFormat(GtexPixelFromat format) { switch (format) { case GtexPixelFromat.Dxt1: return(Format.BC1_UNorm); case GtexPixelFromat.Dxt3: return(Format.BC2_UNorm_SRgb); case GtexPixelFromat.Dxt5: return(Format.BC3_UNorm_SRgb); case GtexPixelFromat.A8R8G8B8: return(Format.B8G8R8A8_UNorm); case GtexPixelFromat.X8R8G8B8: return(Format.B8G8R8X8_UNorm); } throw new NotImplementedException(format.ToString()); }
private static Format GetDxFormat(GtexPixelFromat format) { switch (format) { case GtexPixelFromat.Dxt1: return Format.BC1_UNorm; case GtexPixelFromat.Dxt3: return Format.BC2_UNorm_SRgb; case GtexPixelFromat.Dxt5: return Format.BC3_UNorm_SRgb; case GtexPixelFromat.A8R8G8B8: return Format.B8G8R8A8_UNorm; case GtexPixelFromat.X8R8G8B8: return Format.B8G8R8X8_UNorm; } throw new NotImplementedException(format.ToString()); }