Create the WinGLControl unconditionally in the constructor. Construction/destruction is done lazily when the actual GLControl handle is created/destroyed.

This commit is contained in:
the_fiddler 2009-09-02 22:55:51 +00:00
parent 9d3561dc4e
commit ced435c072

View file

@ -113,21 +113,7 @@ namespace OpenTK
{
this.mode = mode;
control.HandleCreated += delegate(object sender, EventArgs e)
{
if (window_info != null)
window_info.Dispose();
window_info = Utilities.CreateWindowInfo(mode, ((Control)sender).Handle, true);
};
control.HandleDestroyed += delegate(object sender, EventArgs e)
{
if (window_info != null)
{
window_info.Dispose();
window_info = null;
}
};
window_info = Utilities.CreateWindowInfo(mode, control.Handle, true);
}
#endregion