public MapForm() { InitializeComponent(); DoubleBuffered = false; NSGraphicsCanvas gc = new NSGraphicsCanvas(); gc.Dock = DockStyle.Fill; gc.Paint += RenderCallback; gc.Visible = true; Controls.Add(gc); }
void RenderCallback(object sender, PaintEventArgs peArg) { NSGraphicsCanvas gc = (NSGraphicsCanvas)sender; gc.MakeCurrent(); //OpenTK.Graphics.OpenGL.GL.ClearColor(Color.FromArgb(40, 40, 40)); //OpenTK.Graphics.OpenGL.GL.Clear(OpenTK.Graphics.OpenGL.ClearBufferMask.ColorBufferBit); //gc.SwapBuffers(); gc.Swap(); }
/// <summary> /// Конструктор /// </summary> public SkyboxForm() { InitializeComponent(); canvas = new NSGraphicsCanvas(); canvas.Dock = DockStyle.Fill; canvas.Visible = true; canvas.MouseDown += canvas_MouseDown; canvas.MouseUp += canvas_MouseUp; canvas.MouseMove += canvas_MouseMove; Controls.Add(canvas); canvas.BringToFront(); }