In a practice from CodeProject, I used C#; In my window form I select an GLControl from toolbox and put the code below in Resize and load event of this control, but when I run the project the form is blank.
Where is the mistake?
int w = glControl1.Width;
int h = glControl1.Height;
glControl1.MakeCurrent();
Color4 _newColor = new Color4(1f, 0f, 1f, 1f);
GL.ClearColor(_newColor);
glControl1.Invalidate();
GL.MatrixMode(MatrixMode.Projection);
GL.LoadIdentity();
GL.Ortho(-w / 2, w / 2, -h / 2, h / 2, -1, 1);
GL.Viewport(0, 0, w, h);
GL.End();
glControl1.SwapBuffers();