Ejemplo n.º 1
0
        private static Texture2D GetModifiedTexture2D(GraphicsDevice graphicsDevice)
        {
            FlatRedBall.Graphics.Texture.ImageData imageData;

            Texture2D texture = WireframeManager.Self.GetTextureForFrame(SelectedState.Self.SelectedFrame);

            int width = texture.Width;

            if (!MathFunctions.IsPowerOfTwo(width))
            {
                width = MathFunctions.NextPowerOfTwo(width);
            }

            int height = texture.Height;

            if (!MathFunctions.IsPowerOfTwo(height))
            {
                height = MathFunctions.NextPowerOfTwo(height);
            }

            imageData = new Graphics.Texture.ImageData(width, height);

            Rectangle sourceRectangle = new Rectangle(0, 0, texture.Width, texture.Height);

            imageData.Blit(texture, sourceRectangle, new Point(0, 0));

            return(imageData.ToTexture2D(false, graphicsDevice));
        }
Ejemplo n.º 2
0
        private static Texture2D GetModifiedTexture2D(GraphicsDevice graphicsDevice)
        {
            FlatRedBall.Graphics.Texture.ImageData imageData;

            Texture2D texture = WireframeManager.Self.GetTextureForFrame(SelectedState.Self.SelectedFrame);

            int width = texture.Width;
            if (!MathFunctions.IsPowerOfTwo(width))
            {
                width = MathFunctions.NextPowerOfTwo(width);
            }

            int height = texture.Height;
            if (!MathFunctions.IsPowerOfTwo(height))
            {
                height = MathFunctions.NextPowerOfTwo(height);
            }

            imageData = new Graphics.Texture.ImageData(width, height);

            Rectangle sourceRectangle = new Rectangle(0, 0, texture.Width, texture.Height);

            imageData.Blit(texture, sourceRectangle, new Point(0, 0));

            return imageData.ToTexture2D(false, graphicsDevice);
        }