private void Form1_Load(object sender, EventArgs e) { Glut.glutInit(); Glut.glutInitDisplayMode(Glut.GLUT_RGB | Glut.GLUT_DOUBLE); Gl.glClearColor(255, 255, 255, 1); Gl.glViewport(0, 0, AnT.Width, AnT.Height); Gl.glMatrixMode(Gl.GL_PROJECTION); Gl.glLoadIdentity(); if ((float)AnT.Width <= (float)AnT.Height) { ScreenW = 30.0; ScreenH = 30.0 * (float)AnT.Height / (float)AnT.Width; Gl.glOrtho(0.0, ScreenW, 0.0, ScreenH, 100, -100); } else { ScreenW = 30.0 * (float)AnT.Width / (float)AnT.Height; ScreenH = 30.0; Gl.glOrtho(0.0, 30.0 * (float)AnT.Width / (float)AnT.Height, 0.0, 30.0, 100, -100); } devX = (float)ScreenW / (float)AnT.Width; devY = (float)ScreenH / (float)AnT.Height; Gl.glMatrixMode(Gl.GL_MODELVIEW); PointInGrap.Stop(); }
private void button3_Click(object sender, EventArgs e) { PointInGrap.Stop(); }