Пример #1
0
 private void InsertCommandInRenderOrder(IRenderCommand command)
 {
     if (!_renderList.Any())
     {
         _renderList.AddLast(command);
         _renderListContentInsertionPoint = _renderList.First;
     }
     else
     {
         if (command.ProcessStep == RenderProcessPosition.BeforeContent)
         {
             _renderList.AddFirst(command);
         }
         else if (command.ProcessStep == RenderProcessPosition.AfterContent)
         {
             _renderList.AddLast(command);
         }
         else if (command.ProcessStep == RenderProcessPosition.ContentRenderStep)
         {
             _renderList.AddAfter(_renderListContentInsertionPoint, command);
         }
         else
         {
             throw new ArgumentOutOfRangeException();
         }
     }
 }
 public UserInterfaceUpdateCommand(Hud hud, IRenderCommand uiRCommand)
     : base(CommandType.Update)
 {
     this.hud = hud;
     uiUpdateThread = new Thread(Activate) {Name = "UI Update Thread", Priority = ThreadPriority.Lowest};
     EventHandle = new ManualResetEventSlim(false);
     this.uiRCommand = uiRCommand;
     taskQueue = new Queue<UpdateTask>();
 }
Пример #3
0
        public void EnqueueNormal(IRenderCommand command)
        {
            if (command is IRenderDeferredCommand)
            {
                throw new NotSupportedException("Cannot enqueue a deferred render command to the normal queue");
            }

            normalQueue.Enqueue(command);
        }
Пример #4
0
        public void UpdateState(IRenderCommand renderCommand)
        {
            if (renderCommand is RequestPickingInfo requestPicking)
            {
                _requestPicking = requestPicking;
            }

            renderCommand.SetState(_renderInfo);

            InsertCommandInRenderOrder(renderCommand);
        }
Пример #5
0
        private void ProcessRenderCommand(IRenderCommand command, IGraphicsContext context)
        {
            context.Device.SetBlendState(command.BlendState);
            context.Device.SetDepthStencilState(command.DepthStencilState);
            context.Device.SetRasterizerState(command.RasterizerState);

            command.SetGeometry(context);
            command.SetResources(context);
            command.SetConstants(context);

            command.Render(context);
        }
Пример #6
0
 public void AddRenderCommand(IRenderCommand rCommand)
 {
     rCommand.Init();
     commandList.AddLast(rCommand);
 }
Пример #7
0
 public void EnqueuePostProcess(IRenderCommand command)
 {
     // todo: post process might need its own kind of command?
     postProcessQueue.Enqueue(command);
 }
Пример #8
0
 /// <summary>
 /// Вызов события по клику на ссылку.
 /// </summary>
 /// <param name="command">Элемент текста.</param>
 public void OnLinkClick(IRenderCommand command)
 {
     if (command != null)
     {
         if (command.Attributes.ContainsKey(CommonTextAttributes.Link))
         {
             var link = command.Attributes[CommonTextAttributes.Link];
             var uriLink = link as ITextAttributeData<string>;
             var boardLink = link as ITextAttributeData<BoardLinkBase>;
             if (uriLink?.Value != null)
             {
                 OnLinkClick(new LinkTextRenderAttribute(uriLink.Value));
             }
             if (boardLink?.Value != null)
             {
                 OnLinkClick(new LinkTextRenderAttribute("[data]", boardLink.Value));
             }
         }
     }
 }
Пример #9
0
 private void RenderControlOnTextTapped(object sender, IRenderCommand renderCommand)
 {
     ViewModel?.OnLinkClick(renderCommand);
 }