Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
        public void ResizeToNearestPowerOfTwo(SamplingFilter filter, bool regenerateMipMaps)
        {
            int width              = this.Width;
            int height             = this.Height;
            int depth              = this.Depth;
            int nearestPowerOfTwo1 = MemoryHelper.RoundToNearestPowerOfTwo(width);
            int nearestPowerOfTwo2 = MemoryHelper.RoundToNearestPowerOfTwo(height);
            int nearestPowerOfTwo3 = MemoryHelper.RoundToNearestPowerOfTwo(depth);

            this.Bind();
            SamplingFilter samplingFilter = ILU.GetSamplingFilter();

            ILU.SetSamplingFilter(filter);
            ILU.Scale(nearestPowerOfTwo1, nearestPowerOfTwo2, nearestPowerOfTwo3);
            if (regenerateMipMaps)
            {
                this.Bind();
                ILU.BuildMipMaps();
            }
            ILU.SetSamplingFilter(samplingFilter);
        }