Handle, System.Threading.Thread.CurrentThread.ManagedThreadId, Display));
bool result;
- using (new XLock(Display))
+ result = Glx.MakeCurrent(Display, IntPtr.Zero, IntPtr.Zero);
+ if (result)
{
- result = Glx.MakeCurrent(Display, IntPtr.Zero, IntPtr.Zero);
- if (result)
- {
- currentWindow = null;
- }
+ currentWindow = null;
}
+
Debug.Print("{0}", result ? "done!" : "failed.");
}
else
throw new InvalidOperationException("Invalid display, window or context.");
}
- using (new XLock(Display))
+ result = Glx.MakeCurrent(Display, w.Handle, Handle);
+ if (result)
{
- result = Glx.MakeCurrent(Display, w.Handle, Handle);
- if (result)
- {
- currentWindow = w;
- }
+ currentWindow = w;
}
+
+
+
+
if (!result)
{
throw new GraphicsContextException("Failed to make context current.");
if (IsCurrent)
{
- using (new XLock(display))
- {
- Glx.MakeCurrent(display, IntPtr.Zero, IntPtr.Zero);
- }
+ Glx.MakeCurrent(display, IntPtr.Zero, IntPtr.Zero);
}
using (new XLock(display))
{