Hi all, I'm getting started with OpenTK and keep getting an error when trying to load a texture.
The code is pretty much copy pasted from an example:
BitmapData data = bitmap.LockBits(new Rectangle(0, 0, bitmap.Width, bitmap.Height), ImageLockMode.ReadOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb); GL.TexImage2D(TextureTarget.Texture2D, 0, PixelInternalFormat.Rgba, data.Width, data.Height, 0, OpenTK.Graphics.OpenGL.PixelFormat.Bgra, PixelType.UnsignedByte, data.Scan0); bitmap.UnlockBits(data);
On my desktop, it works fine and I get a valid texture. On my netbook, it crashes at the second last line and gives me an "Invalid Value" which seems to point to "PixelType.UnsignedByte".
I think the issue may be that the netbook's graphics card doesn't support mip mapping on non power-of-2 textures as is the case with the one I'm loading. How do I tell it not to generate mipmaps if that's the issue, or what else can it be?