/// <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; } }
/// <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)); }
public void ReleaseSurface(DisplaySurface surface) { lock (this) _releasedSurfaces.Enqueue(surface); }