public void Release() { if (_ctx != null) { _ctx.Release(); } }
public void Capture(bool force = false) { try { //Only proceed if this window is not already current if (force || CurrentContext != this) { //Release the current context if it exists CurrentContext?.Release(); //Make this context the current one CurrentContext = this; if (!_context.IsCurrent) { _context.MakeCurrent(WindowInfo); } ContextChanged?.Invoke(true); } } catch //(Exception x) { //MessageBox.Show(x.ToString()); Reset(); } }
public void Capture() { try { bool notThis = CurrentlyEnabled != this && CurrentlyEnabled != null && CurrentlyEnabled._context.IsCurrent; if (notThis) { CurrentlyEnabled.Release(); } CurrentlyEnabled = this; if (!_context.IsCurrent) { _context.MakeCurrent(WindowInfo); } if (ContextChanged != null && notThis) { ContextChanged(true); } } catch //(Exception x) { //MessageBox.Show(x.ToString()); Reset(); } }
public void Release() { _ctx?.Release(); }