예제 #1
0
        private void WriteDx10Header(Ibasa.IO.BinaryWriter writer)
        {
            if (!IsDX10Mode)
                return;

            writer.Write((int)DxgiFormat);
            writer.Write((int)ResourceDimension);
            writer.Write((int)MiscFlags);
            writer.Write(ArraySize);
            writer.Write(new byte[4]); //write padding
        }
예제 #2
0
 private void WriteData(Ibasa.IO.BinaryWriter writer)
 {
     if (IsDX10Mode)
     {
         for (int arraySlice = 0; arraySlice < Image.ArraySize; ++arraySlice)
         {
             for (int mipSlice = 0; mipSlice < Image.MipLevels; ++mipSlice)
             {
                 byte[] subresource = Image[mipSlice, arraySlice];
                 writer.Write(subresource);
             }
         }
     }
     else if (PixelFlags.HasFlag(PixelFlagsEnum.FourCC))
     {
         for (int arraySlice = 0; arraySlice < Image.ArraySize; ++arraySlice)
         {
             for (int mipSlice = 0; mipSlice < Image.MipLevels; ++mipSlice)
             {
                 byte[] subresource = Image[mipSlice, arraySlice];
                 writer.Write(subresource);
             }
         }
     }
     else
     {
         for (int arraySlice = 0; arraySlice < Image.ArraySize; ++arraySlice)
         {
             for (int mipSlice = 0; mipSlice < Image.MipLevels; ++mipSlice)
             {
                 byte[] subresource = Image[mipSlice, arraySlice];
                 writer.Write(subresource);
             }
         }
     }
 }
예제 #3
0
        private void WriteHeader(Ibasa.IO.BinaryWriter writer)
        {
            writer.Write((int)HeaderFlags);
            writer.Write(Height);
            writer.Write(Width);
            writer.Write(Pitch);
            writer.Write(Depth);
            writer.Write(MipmapCount);
            writer.Write(new byte[44]); //write padding

            writer.Write(32);
            writer.Write((int)PixelFlags);
            writer.Write((int)FourCC);
            writer.Write(RGBBitCount);
            writer.Write(RBitMask);
            writer.Write(GBitMask);
            writer.Write(BBitMask);
            writer.Write(ABitMask);

            writer.Write((int)SurfaceFlags);
            writer.Write((int)CubemapFlags);
            writer.Write(new byte[12]); //write padding
        }