UI should update when changing fonts.

This commit is contained in:
the_fiddler 2008-11-26 16:35:19 +00:00
parent c0549b11fa
commit a5c733774a

View file

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