diff --git a/Source/Examples/WinForms/W03_Extensions.cs b/Source/Examples/WinForms/W03_Extensions.cs index 1191bd7d..0d3dc254 100644 --- a/Source/Examples/WinForms/W03_Extensions.cs +++ b/Source/Examples/WinForms/W03_Extensions.cs @@ -42,6 +42,15 @@ namespace Examples.WinForms glControl.CreateContext(); + listBox1.BeginInvoke(new LoadExtensionsDelegate(LoadExtensions)); + } + + delegate void LoadExtensionsDelegate(); + + void LoadExtensions() + { + glControl.MakeCurrent(); + FieldInfo[] v = delegatesClass.GetFields(BindingFlags.Static | BindingFlags.NonPublic); int i = 0, supported = 0; @@ -53,7 +62,7 @@ namespace Examples.WinForms Delegate d = GL.GetDelegate(f.Name, f.FieldType); f.SetValue(null, d); - this.listBox1.Items.Add(String.Format("{0}/{1} {2}: {3}", + listBox1.Items.Add(String.Format("{0}/{1} {2}: {3}", (++i).ToString(), v.Length, d != null ? "ok" : "failed", f.Name)); if (d != null) @@ -62,7 +71,7 @@ namespace Examples.WinForms } } - this.Text = String.Format("Supported extensions: {0}", supported); + //this.Text = String.Format("Supported extensions: {0}", supported); } catch (Exception expt) {