mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-07-16 16:37:34 +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;
|
this.mode = mode;
|
||||||
|
|
||||||
control.HandleCreated += delegate(object sender, EventArgs e)
|
window_info = Utilities.CreateWindowInfo(mode, control.Handle, true);
|
||||||
{
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
Loading…
Reference in a new issue