public static DdsFileHeaderDx10 Read(Stream inputStream) { DdsFileHeaderDx10 result = new DdsFileHeaderDx10(); BinaryReader reader = new BinaryReader(inputStream, Encoding.Default, true); result.Format = (DxgiFormat) reader.ReadUInt32(); result.ResourceDimension = (D3D10ResourceDimension) reader.ReadInt32(); result.MiscFlag = reader.ReadUInt32(); result.ArraySize = reader.ReadUInt32(); return result; }
public static DdsFileHeaderDx10 Read(Stream inputStream) { DdsFileHeaderDx10 result = new DdsFileHeaderDx10(); BinaryReader reader = new BinaryReader(inputStream, Encoding.Default, true); result.Format = (DxgiFormat)reader.ReadUInt32(); result.ResourceDimension = (D3D10ResourceDimension)reader.ReadInt32(); result.MiscFlag = reader.ReadUInt32(); result.ArraySize = reader.ReadUInt32(); return(result); }
public static DdsFile Read(Stream inputStream) { DdsFile result = new DdsFile(); BinaryReader reader = new BinaryReader(inputStream, Encoding.Default, true); reader.Assert(MagicNumber); result.Header = DdsFileHeader.Read(inputStream); if (result.Header.IsDx10()) { result.HeaderDx10 = DdsFileHeaderDx10.Read(inputStream); } MemoryStream dataStream = new MemoryStream(); inputStream.CopyTo(dataStream); result.Data = dataStream.ToArray(); return(result); }