mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-01-22 21:51:08 +00:00
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:
parent
9d3561dc4e
commit
ced435c072
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue