public void Dispose() { if (State == (int)States.Disposed) { return; } foreach (var batch in BatchesToRelease) { batch.ReleaseResources(); } BatchesToRelease.Clear(); var _batches = Batches.GetBuffer(false); for (int i = 0; i < Batches.Count; i++) { var batch = _batches[i]; if (batch != null) { batch.ReleaseResources(); } } Batches.Dispose(); RenderManager.ReleaseFrame(this); State = (int)States.Disposed; }
public void Dispose() { if (State == (int)States.Disposed) { return; } foreach (var batch in BatchesToRelease) { batch.ReleaseResources(); } BatchesToRelease.Clear(); Batch temp; for (int i = 0, c = Batches.Count; i < Batches.Count; i++) { if (Batches.TryGetItem(i, out temp)) { temp.ReleaseResources(); } } Batches.Dispose(); RenderManager.ReleaseFrame(this); State = (int)States.Disposed; }
protected override void OnReleaseResources() { _DrawCalls.Dispose(); base.OnReleaseResources(); }