mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-01-20 19:11:06 +00:00
Stop using DisplayLocks for every MakeCurrent context call.
This commit is contained in:
parent
bbfc98853e
commit
67563520ff
|
@ -319,14 +319,12 @@ namespace OpenTK.Platform.X11
|
||||||
Handle, System.Threading.Thread.CurrentThread.ManagedThreadId, Display));
|
Handle, System.Threading.Thread.CurrentThread.ManagedThreadId, Display));
|
||||||
|
|
||||||
bool result;
|
bool result;
|
||||||
using (new XLock(Display))
|
|
||||||
{
|
|
||||||
result = Glx.MakeCurrent(Display, IntPtr.Zero, IntPtr.Zero);
|
result = Glx.MakeCurrent(Display, IntPtr.Zero, IntPtr.Zero);
|
||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
currentWindow = null;
|
currentWindow = null;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
Debug.Print("{0}", result ? "done!" : "failed.");
|
Debug.Print("{0}", result ? "done!" : "failed.");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -342,14 +340,15 @@ namespace OpenTK.Platform.X11
|
||||||
throw new InvalidOperationException("Invalid display, window or context.");
|
throw new InvalidOperationException("Invalid display, window or context.");
|
||||||
}
|
}
|
||||||
|
|
||||||
using (new XLock(Display))
|
|
||||||
{
|
|
||||||
result = Glx.MakeCurrent(Display, w.Handle, Handle);
|
result = Glx.MakeCurrent(Display, w.Handle, Handle);
|
||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
currentWindow = w;
|
currentWindow = w;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (!result)
|
if (!result)
|
||||||
{
|
{
|
||||||
|
@ -487,12 +486,9 @@ namespace OpenTK.Platform.X11
|
||||||
IntPtr display = Display;
|
IntPtr display = Display;
|
||||||
|
|
||||||
if (IsCurrent)
|
if (IsCurrent)
|
||||||
{
|
|
||||||
using (new XLock(display))
|
|
||||||
{
|
{
|
||||||
Glx.MakeCurrent(display, IntPtr.Zero, IntPtr.Zero);
|
Glx.MakeCurrent(display, IntPtr.Zero, IntPtr.Zero);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
using (new XLock(display))
|
using (new XLock(display))
|
||||||
{
|
{
|
||||||
Glx.DestroyContext(display, Handle);
|
Glx.DestroyContext(display, Handle);
|
||||||
|
|
Loading…
Reference in a new issue