using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using OpenTK.Graphics; using OpenTK.Graphics.OpenGL; namespace OpenTK_issue_TutorialOutdated { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { this.ClientSize = new Size(640, 480); } private void glControl1_Resize(object sender, EventArgs e) { int w = glControl1.Width; int h = glControl1.Height; GL.Viewport(0, 0, w, h); // Use all of the glControl painting area } private void glControl1_Paint(object sender, PaintEventArgs e) { GL.ClearColor(Color.Navy); GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit); GL.MatrixMode(MatrixMode.Modelview); GL.LoadIdentity(); GL.Begin(BeginMode.Triangles); GL.Color3(Color.Red); GL.Vertex2(0, 0); GL.Color3(Color.Green); GL.Vertex2(1, 0); GL.Color3(Color.Blue); GL.Vertex2(0, 1); GL.End(); glControl1.SwapBuffers(); } private void glControl1_Load(object sender, EventArgs e) { } } }