Set default texture parameters before allocating memory for the texture.

This commit is contained in:
the_fiddler 2008-11-29 18:22:51 +00:00
parent 9f3919e0be
commit 3a2aa4ece6

View file

@ -218,6 +218,8 @@ namespace OpenTK.Graphics
if (id == 0)
throw new GraphicsResourceException(String.Format("Texture creation failed, (Error: {0})", GL.GetError()));
SetDefaultTextureParameters(id);
GL.TexImage2D(TextureTarget.Texture2D, 0, InternalFormat, Width, Height, 0,
OpenTK.Graphics.PixelFormat.Rgba, PixelType.UnsignedByte, IntPtr.Zero);
@ -264,7 +266,6 @@ namespace OpenTK.Graphics
context = GraphicsContext.CurrentContext;
id = CreateTexture(Width, Height);
SetDefaultTextureParameters(id);
}
return id;