示例#1
0
 public void Release()
 {
     if (_ctx != null)
     {
         _ctx.Release();
     }
 }
示例#2
0
        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();
            }
        }
示例#3
0
        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();
            }
        }
示例#4
0
 public void Release()
 {
     _ctx?.Release();
 }