Aiv.Fast2D.Texture.AddMipMap C# (CSharp) Method

AddMipMap() public method

public AddMipMap ( int mipMap, string fileName ) : void
mipMap int
fileName string
return void
        public void AddMipMap(int mipMap, string fileName)
        {
            int width;
            int height;
            byte[] bitmap = this.LoadImage(fileName, out width, out height);
            int expectedWidth = this.width / (int)Math.Pow(2, mipMap);
            int expectedHeight = this.height / (int)Math.Pow(2, mipMap);

            if (width != expectedWidth || height != expectedHeight)
                throw new Exception("invalid mipmap size");

            this.Update(bitmap, mipMap);
        }