Esempio n. 1
0
        Texture2D LoadCubeMap(System.IO.FileInfo _fileName)
        {
            if (!_fileName.Exists)
            {
                throw new Exception("File not found!");
            }

            string Ext = _fileName.Extension.ToLower();

            switch (Ext)
            {
            case ".dds":
                using (ImageUtility.ImagesMatrix I = new ImageUtility.ImagesMatrix()) {
                    I.DDSLoadFile(_fileName);
                    return(new Texture2D(m_Device, I, ImageUtility.COMPONENT_FORMAT.AUTO));
                }

            case ".bimage": {
                BImage I = new BImage(_fileName);
                return(I.CreateTextureCube(m_Device));
            }

            default:
                throw new Exception("Unsupported image extension!");
            }
        }
Esempio n. 2
0
        Texture2D LoadCubeMap(System.IO.FileInfo _FileName)
        {
            if (!_FileName.Exists)
            {
                throw new Exception("File not found!");
            }

            string Ext = _FileName.Extension.ToLower();

            switch (Ext)
            {
            case ".dds":
                return(DirectXTexManaged.TextureCreator.CreateTexture2DFromDDSFile(m_Device, _FileName.FullName));

            case ".bimage": {
                BImage I = new BImage(_FileName);
                return(I.CreateTextureCube(m_Device));
            }

            default:
                throw new Exception("Unsupported image extension!");
            }
        }
Esempio n. 3
0
        Texture2D LoadCubeMap( System.IO.FileInfo _FileName )
        {
            if ( !_FileName.Exists )
                throw new Exception( "File not found!" );

            string	Ext = _FileName.Extension.ToLower();
            switch ( Ext ) {
                case ".dds":
                    return DirectXTexManaged.TextureCreator.CreateTexture2DFromDDSFile( m_Device, _FileName.FullName );
                case ".bimage": {
                    BImage I = new BImage( _FileName );
                    return I.CreateTextureCube( m_Device );
                }
                default:
                    throw new Exception( "Unsupported image extension!" );
            }
        }
Esempio n. 4
0
 public ImageSlice(BImage _Owner, BinaryReader _R, uint _MipOffset)
 {
     m_Owner = _Owner;
     Read(_R, _MipOffset);
 }
Esempio n. 5
0
 public ImageSlice( BImage _Owner, BinaryReader _R, uint _MipOffset )
 {
     m_Owner = _Owner;
     Read( _R, _MipOffset );
 }