From b6d42d0ba653437c7e7075e1a38a3377a96be86d Mon Sep 17 00:00:00 2001 From: Semyon Kirnosenko Date: Fri, 10 Jul 2015 12:39:30 +0400 Subject: [PATCH] texture method to generate mipmaps --- MonoGame.Framework/Graphics/Texture2D.DirectX.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/MonoGame.Framework/Graphics/Texture2D.DirectX.cs b/MonoGame.Framework/Graphics/Texture2D.DirectX.cs index 868ca6f81f8..249fb623d37 100644 --- a/MonoGame.Framework/Graphics/Texture2D.DirectX.cs +++ b/MonoGame.Framework/Graphics/Texture2D.DirectX.cs @@ -36,7 +36,12 @@ private void PlatformConstruct(int width, int height, bool mipmap, SurfaceFormat // Create texture GetTexture(); - } + } + + public void GenerateMipMaps(GraphicsDevice device) + { + device._d3dContext.GenerateMips(GetShaderResourceView()); + } private void PlatformSetData(int level, int arraySlice, Rectangle? rect, T[] data, int startIndex, int elementCount) where T : struct {