예제 #1
0
 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;
 }
예제 #2
0
        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);
        }
예제 #3
0
파일: DdsFile.cs 프로젝트: shdwdln/FtexTool
        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);
        }