mirror of
https://github.com/Ryujinx/Opentk.git
synced 2024-12-23 20:05:30 +00:00
Fixed crash in MakeCurrent(null)
MakeCurrent(null) should set the bound device context to zero.
This commit is contained in:
parent
0a46e20029
commit
30cd9cb7f8
|
@ -279,14 +279,14 @@ namespace OpenTK.Platform.Windows
|
||||||
throw new ArgumentException("window", "Must point to a valid window.");
|
throw new ArgumentException("window", "Must point to a valid window.");
|
||||||
|
|
||||||
success = Wgl.MakeCurrent(wnd.DeviceContext, Handle.Handle);
|
success = Wgl.MakeCurrent(wnd.DeviceContext, Handle.Handle);
|
||||||
|
device_context = wnd.DeviceContext;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
success = Wgl.MakeCurrent(IntPtr.Zero, IntPtr.Zero);
|
success = Wgl.MakeCurrent(IntPtr.Zero, IntPtr.Zero);
|
||||||
|
device_context = IntPtr.Zero;
|
||||||
}
|
}
|
||||||
|
|
||||||
device_context = wnd.DeviceContext;
|
|
||||||
|
|
||||||
if (!success)
|
if (!success)
|
||||||
{
|
{
|
||||||
throw new GraphicsContextException(String.Format(
|
throw new GraphicsContextException(String.Format(
|
||||||
|
|
Loading…
Reference in a new issue