Exemple #1
0
 public void End()
 {
     if (!BatchBegan)
     {
         throw new System.Exception("Call Batch Begin");
     }
     Flush();
     CurrentMaterial.End();
     UnBindBuffers();
     BatchBegan = false;
 }
Exemple #2
0
        public void Finish()
        {
            if (CurrentMaterial != null)
            {
                CurrentMaterial.End(this);
                CurrentMaterial = null;
            }

            RenderManager.ResetDeviceState(Device);

            Device.SetRenderTargets();
            Device.SetVertexBuffer(null);
        }
Exemple #3
0
        public void Finish()
        {
            if (CurrentMaterial != null)
            {
                CurrentMaterial.End(this);
                CurrentMaterial = null;
            }

            for (var i = 0; i < 4; i++)
            {
                Device.Textures[i] = null;
            }

            Device.SetRenderTargets();
            Device.SetVertexBuffer(null);
        }
Exemple #4
0
        public void Finish()
        {
            if (CurrentMaterial != null)
            {
                CurrentMaterial.End(this);
                CurrentMaterial = null;
            }

            RenderManager.ResetDeviceState(Device);

            SetRenderTargets(null, isPushPop: true);
            Device.SetVertexBuffer(null);

#if DEBUG
            int threshold = 2;
            if (BatchGroupStack.Count >= threshold)
            {
                throw new Exception("Unbalanced batch group stack");
            }
            if (RenderTargetStack.Count >= threshold)
            {
                throw new Exception("Unbalanced render target stack");
            }
            if (BlendStateStack.Count >= threshold)
            {
                throw new Exception("Unbalanced blend state stack");
            }
            if (RasterizerStateStack.Count >= threshold)
            {
                throw new Exception("Unbalanced rasterizer state stack");
            }
            if (DepthStencilStateStack.Count >= threshold)
            {
                throw new Exception("Unbalanced depth/stencil state stack");
            }
#endif

            BatchGroupStack.Clear();
            RenderTargetStack.Clear();
            BlendStateStack.Clear();
            RasterizerStateStack.Clear();
            DepthStencilStateStack.Clear();
        }