Пример #1
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;
        }
Пример #2
0
 new protected void Initialize(
     IBatchContainer container, int layer, Material material,
     bool addToContainer, int?capacity = null
     )
 {
     _DrawCalls.ListPool = _ListPool;
     _DrawCalls.Clear();
     base.Initialize(container, layer, material, addToContainer);
 }
Пример #3
0
 internal void Initialize(RenderManager renderManager, int index)
 {
     Batches.ListPool = _ListPool;
     Batches.Clear();
     RenderManager     = renderManager;
     Index             = index;
     InitialBatchCount = Batch.LifetimeCount;
     State             = (int)States.Initialized;
     BatchesToRelease.Clear();
 }
Пример #4
0
 internal void Initialize(RenderCoordinator coordinator, RenderManager renderManager, int index)
 {
     Batches.ListPoolOrAllocator = _ListPool;
     Batches.Clear();
     Coordinator        = coordinator;
     this.RenderManager = renderManager;
     Index = index;
     State = (int)States.Initialized;
     Label = "Frame";
     ChangeRenderTargets = true;
     if (PrepareData == null)
     {
         PrepareData = new FramePrepareData();
     }
     else
     {
         PrepareData.Initialize();
     }
 }