{\r
try\r
{\r
+ int testID = -1;\r
+ Bitmap testPic = new Bitmap(1, 1);\r
+ BitmapData testData = testPic.LockBits(new Rectangle(0, 0, 1, 1), ImageLockMode.ReadOnly, System.Drawing.Imaging.PixelFormat.Format24bppRgb);\r
+ GL.GenTextures(1, out testID);\r
+ GL.TexImage2D(TextureTarget.Texture2D, 0, PixelInternalFormat.Rgb8, 1, 1, 0, OpenTK.Graphics.OpenGL.PixelFormat.Bgr, PixelType.UnsignedByte, testData.Scan0);\r
+ GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.LinearMipmapLinear);\r
+ GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.GenerateMipmap, 1);\r
GL.GenerateMipmap(GenerateMipmapTarget.Texture2D);\r
+ testPic.UnlockBits(testData);\r
+ testPic.Dispose();\r
+ GL.DeleteTexture(testID);\r
}\r
catch\r
{\r
private void SetPerspective()\r
{\r
float dAspRat = (float)glControl.Width / (float)glControl.Height;\r
- GluPerspective(50.0f * Camera.Zoom, dAspRat, 0.1f, (float)Camera.Far * 3);\r
+ GluPerspective(50.0f * Camera.Zoom, dAspRat, 0.1f, 1000f);\r
}\r
\r
\r
}\r
#endregion Context menu\r
}\r
-\r
}\r