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

            RenderManager.ResetDeviceState(Device);

            Device.SetRenderTargets();
            Device.SetVertexBuffer(null);
        }
示例#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);
        }
示例#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();
        }