Esempio n. 1
0
 public override void EndRender()
 {
     if (_lastBeginContext != null)
     {
         _lastBeginContext.EndRender();
     }
 }
Esempio n. 2
0
        protected override bool BeginRenderBrushOverride(PrimitiveBuffer primitiveContext, RenderContext renderContext)
        {
            // Clear last context
            _lastBeginContext = null;
            bool result = false;

            foreach (var brushContext in _brushContexts)
            {
                // We can only begin a new render pass if the previous ended
                if (_lastBeginContext != null && brushContext.IsValid())
                {
                    _lastBeginContext.Render(0);
                    _lastBeginContext.EndRender();
                    _lastBeginContext = null;
                }

                var currentResult = brushContext.BeginRenderBrushOverride(primitiveContext, renderContext);
                result |= currentResult;
                if (currentResult)
                {
                    _lastBeginContext = brushContext;
                }
            }
            return(result);
        }