OpenGL gl = openGLControl.OpenGL; int[] vp = new int[4]; //gl.Ortho2D(mousePos.X, mousePos.X + 0.1, mousePos.Y + 0.0001, mousePos.Y + 0.0001); //gl.MatrixMode(OpenGL.GL_PROJECTION); ////gl.Ortho2D(mousePos.X, mousePos.X,1, 1); gl.Ortho2D(left -(top-bottom)*(aspect % 1)/2 , right+ (top - bottom) * (aspect % 1) / 2, bottom, top); gl.LoadIdentity(); gl.PickMatrix(mousePos.X, mousePos.Y,0, 0, vp); uint[] selectBuffer = new uint[100]; gl.SelectBuffer(100, selectBuffer); gl.PushMatrix(); //int[] vp = new int[4]; //gl.GetInteger(OpenGL.GL_VIEWPORT, vp); gl.InitNames(); gl.PushName(0); gl.Begin(OpenGL.GL_POINTS); gl.PointSize(20); gl.Color(1.0f, 1.0f, 0.0f); gl.Vertex(1.32, 0.5); gl.End(); gl.LoadIdentity(); gl.PushName(1); gl.Begin(OpenGL.GL_POINTS); gl.PointSize(20); gl.Color(1.0f, 0.8f, 0.0f); gl.Vertex(0.55, 0.55); gl.End(); //gl.PickMatrix(e.GetPosition(openGLControl).X, openGLControl.ActualHeight - e.GetPosition(openGLControl).Y, 4, 4, vp); //gl.Ortho2D(left, right, bottom, top); /// //gl.Begin(OpenGL.GL_POINTS); //gl.PointSize(20); //gl.Color(1.0f, 1.0f, 0.0f); //gl.Vertex(0.5, 0.5); //gl.End(); ///// //gl.MatrixMode(OpenGL.GL_PROJECTION); //gl.PopMatrix(); int hits = gl.RenderMode(OpenGL.GL_RENDER);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)