Permalink
Browse files

Moved GL.TexParameter calls to before GL.TexImage2D, as recommended b…

…y AMD/ATI. This ensures that no slow format conversion will take place.

git-svn-id: https://opentk.svn.sourceforge.net/svnroot/opentk/trunk@3083 ebc5dd9b-fb1d-0410-b6f8-d24c324e9604
  • Loading branch information...
1 parent 79ce8ba commit ab7e6e639f2513bb9eabcecd16baa0c415017abe the_fiddler committed Sep 6, 2011
Showing with 2 additions and 3 deletions.
  1. +2 −3 Source/Examples/OpenGL/1.x/Textures.cs
@@ -43,6 +43,8 @@ protected override void OnLoad(EventArgs e)
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 @@ protected override void OnLoad(EventArgs e)
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

0 comments on commit ab7e6e6

Please sign in to comment.