diff --git a/Source/Examples/WinForms/FontRendering.cs b/Source/Examples/WinForms/FontRendering.cs index 1d18a438..4427d611 100644 --- a/Source/Examples/WinForms/FontRendering.cs +++ b/Source/Examples/WinForms/FontRendering.cs @@ -50,6 +50,7 @@ namespace Examples.WinForms private void glControl1_Load(object sender, EventArgs e) { + glControl1.MakeCurrent(); GL.ClearColor(Color.SteelBlue); } @@ -58,10 +59,10 @@ namespace Examples.WinForms if (fontDialog.ShowDialog() == DialogResult.OK) { UpdateFontList(fontDialog.Font); + glControl1.Invalidate(); } } - private void textBox1_TextChanged(object sender, EventArgs e) { glControl1.Invalidate(); @@ -69,6 +70,7 @@ namespace Examples.WinForms private void glControl1_Paint(object sender, PaintEventArgs e) { + glControl1.MakeCurrent(); GL.Clear(ClearBufferMask.ColorBufferBit); GL.Color3(Color.White); @@ -87,6 +89,8 @@ namespace Examples.WinForms private void glControl1_Resize(object sender, EventArgs e) { + glControl1.MakeCurrent(); + if (glControl1.ClientSize.Height == 0) glControl1.ClientSize = new System.Drawing.Size(glControl1.ClientSize.Width, 1);