Beispiel #1
0
        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;
        }
Beispiel #2
0
        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;
        }
Beispiel #3
0
 protected override void OnReleaseResources()
 {
     _DrawCalls.Dispose();
     base.OnReleaseResources();
 }