49 {
50 if (_remake && _textures != null)
51 {
52 ClearTexture();
53
55
56 GL.BindTexture(TextureTarget.Texture2D,
_texId);
57 GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureBaseLevel, 0);
58 GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMaxLevel, _textures.Length - 1);
59 GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinLod, 0);
60 GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMaxLod, _textures.Length - 1);
61
62
63 for (int i = 0; i < _textures.Length; i++)
64 {
65 Bitmap bmp = _textures[i];
66 if (bmp != null)
67 {
68 BitmapData data = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height),
69 ImageLockMode.ReadOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
70 GL.TexImage2D(TextureTarget.Texture2D, i, ifmt, data.Width, data.Height, 0,
71 OpenTK.Graphics.OpenGL.PixelFormat.Bgra, PixelType.UnsignedByte, data.Scan0);
72 bmp.UnlockBits(data);
73 }
74 }
75
76 _remake = false;
77 ClearImages();
78 }
79
81 }
int _texId
Definition: GLTexture.cs:13