示例#1
0
        public void ResizeToNearestPowerOfTwo(SamplingFilter filter, bool regenerateMipMaps)
        {
            int width  = Width;
            int height = Height;
            int depth  = Depth;

            width  = MemoryHelper.RoundToNearestPowerOfTwo(width);
            height = MemoryHelper.RoundToNearestPowerOfTwo(height);
            depth  = MemoryHelper.RoundToNearestPowerOfTwo(depth);

            Bind();

            SamplingFilter oldFilter = ILU.GetSamplingFilter();

            ILU.SetSamplingFilter(filter);
            ILU.Scale(width, height, depth);

            if (regenerateMipMaps)
            {
                Bind();
                ILU.BuildMipMaps();
            }

            ILU.SetSamplingFilter(oldFilter);
        }
示例#2
0
        public bool BuildMipMaps(Image image)
        {
            if (image == null || !image.IsValid)
            {
                return(false);
            }

            IL.BindImage(image.ImageID);
            return(ILU.BuildMipMaps());
        }
示例#3
0
        public void Resize(int width, int height, int depth, SamplingFilter filter, bool regenerateMipMaps)
        {
            width  = Math.Max(1, width);
            height = Math.Max(1, height);
            depth  = Math.Max(1, depth);

            Bind();

            SamplingFilter oldFilter = ILU.GetSamplingFilter();

            ILU.SetSamplingFilter(filter);
            ILU.Scale(width, height, depth);

            if (regenerateMipMaps)
            {
                Bind();
                ILU.BuildMipMaps();
            }

            ILU.SetSamplingFilter(oldFilter);
        }