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