From 3297ed54ed9325bba010977f0c5a40da61ffeea7 Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Tue, 6 Sep 2011 12:15:51 +0000 Subject: [PATCH] Moved GL.TexParameter calls to before GL.TexImage2D, as recommended by AMD/ATI. This ensures that no slow format conversion will take place. --- Source/Examples/OpenGL/1.x/Textures.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Source/Examples/OpenGL/1.x/Textures.cs b/Source/Examples/OpenGL/1.x/Textures.cs index 9d0e23d0..4beea6c9 100644 --- a/Source/Examples/OpenGL/1.x/Textures.cs +++ b/Source/Examples/OpenGL/1.x/Textures.cs @@ -43,6 +43,8 @@ namespace Examples.Tutorial GL.GenTextures(1, out texture); GL.BindTexture(TextureTarget.Texture2D, texture); + GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.Linear); + GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (int)TextureMagFilter.Linear); BitmapData data = bitmap.LockBits(new System.Drawing.Rectangle(0, 0, bitmap.Width, bitmap.Height), ImageLockMode.ReadOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb); @@ -51,9 +53,6 @@ namespace Examples.Tutorial OpenTK.Graphics.OpenGL.PixelFormat.Bgra, PixelType.UnsignedByte, data.Scan0); bitmap.UnlockBits(data); - - GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.Linear); - GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (int)TextureMagFilter.Linear); } #endregion