Exemple #1
0
 /// <summary>
 /// sets the provided buffer as pending. takes control of the supplied buffer
 /// </summary>
 public void SetPending(DisplaySurface newPending)
 {
     lock (this)
     {
         if (_pending != null)
         {
             _releasedSurfaces.Enqueue(_pending);
         }
         _pending   = newPending;
         _isPending = true;
     }
 }
Exemple #2
0
        /// <summary>
        /// returns the current buffer, making the most recent pending buffer (if there is such) as the new current first.
        /// </summary>
        public DisplaySurface GetCurrent()
        {
            lock (this)
            {
                if (_isPending)
                {
                    if (_current != null)
                    {
                        _releasedSurfaces.Enqueue(_current);
                    }
                    _current   = _pending;
                    _pending   = null;
                    _isPending = false;
                }
            }

            return(_current);
        }
 public Texture2d Get(DisplaySurface ds)
 {
     using var bb = new BitmapBuffer(ds.PeekBitmap(), new BitmapLoadOptions());
     return(Get(bb));
 }
Exemple #4
0
 public void ReleaseSurface(DisplaySurface surface)
 {
     lock (this) _releasedSurfaces.Enqueue(surface);
 }