Example #1
0
        public void Render()
        {
            IGraphicsService      graphicsService = GameService.GetService <IGraphicsService>();
            IGraphicsPipelineNode currentNode     = StartNode;

            while (currentNode != null)
            {
                if (!graphicsService.IsDrawing)
                {
                    currentNode.Prep();
                    graphicsService.StartDrawing();
                }
                IGraphicsPipelineNode nextNode = currentNode.PopAndRender();
                if (
                    nextNode != null &&
                    (
                        nextNode.ActiveEffect != currentNode.ActiveEffect ||
                        nextNode.DepthState != currentNode.DepthState ||
                        nextNode.TargetID != currentNode.TargetID
                    )
                    )
                {
                    graphicsService.EndDrawing();
                }
                currentNode = nextNode;
            }
            graphicsService.EndDrawing();
        }
Example #2
0
        public GraphicsPipeline(IGraphicsPipelineNode StartNode, params IGraphicsPipelineNode[] Nodes)
        {
            this.StartNode = StartNode;
            var currentNode = this.StartNode;

            foreach (IGraphicsPipelineNode node in Nodes)
            {
                currentNode = currentNode.Extend(node);
            }
        }
Example #3
0
 public IGraphicsPipelineNode Extend(IGraphicsPipelineNode Next)
 {
     this.Next = Next;
     return(this.Next);
 }