Beispiel #1
0
        public override void SyncBuffer(IGUIGraphicsBind guibind)
        {
            if (!m_needUpdateBuffer)
            {
                return;
            }

            var bind = guibind;

            bind.SyncDrawTarget(this, m_drawTarget);
        }
Beispiel #2
0
        public void Destroy()
        {
            m_graphicsBind.Destroy();
            m_graphicsBind = null;

            foreach (var layer in m_layers)
            {
                layer.Destroy();
            }
            m_layers.Clear();
        }
Beispiel #3
0
        public static void Init(IGUIEventHandler eventHandler, IGUIGraphicsBind graphicsBind, IFontInfo fontinfo)
        {
            s_eventHandler = eventHandler;
            s_graphicsBind = graphicsBind;

            s_ctx       = new GUICtx();
            s_ctx.Font  = fontinfo;
            GUI.Context = s_ctx;

            s_drawStages = new List <GUIDrawStage>();
            s_drawStages.Add(new GUIDrawStageOverlay("Overlay", 1));
            s_drawStages.Add(new GUIDrawStageMain("Main", 499));
            s_drawStages.Sort((a, b) => { return(a.Order.CompareTo(b.Order)); });

            eventHandler.EventUpdate += Update;
        }
Beispiel #4
0
        public override void SyncBuffer(IGUIGraphicsBind guibind)
        {
            var bind = guibind;

            if (!m_needSyncBuffer)
            {
                if (GUI.Context.componentStack.Count == 0 && (m_lastBufferSizeText != 0 || m_lastBufferSizeRect != 0))
                {
                    m_lastBufferSizeText        = 0;
                    m_lastBufferSizeRect        = 0;
                    bind.NeedRebuildCommandList = true;
                }
                return;
            }

            bind.SyncDrawTarget(this, m_drawTarget);

            //remove bufferdata
            var compstack = GUI.Context.componentStack;

            while (true)
            {
                if (compstack.Count == 0)
                {
                    break;
                }
                var comp = compstack.Peek();
                if (comp.Destroy)
                {
                    m_drawTarget.bufferRect.RemoveRange(comp.BufferRectStart, comp.BufferRectCount);
                    m_drawTarget.bufferText.RemoveRange(comp.BufferTextStart, comp.BufferTextCount);
                    compstack.Pop();
                }
                else
                {
                    break;
                }
            }
        }
Beispiel #5
0
 public static void Init(IRigelWindowEventHandler eventHandler, IGUIGraphicsBind bind, IFontInfo fontinfo)
 {
     Init(new GUIEventHandler(eventHandler), bind, fontinfo);
 }
Beispiel #6
0
        public GUIForm(IGUIGraphicsBind bind)
        {
            m_graphicsBind = bind;

            m_layers = new List <GUILayer>();
        }
Beispiel #7
0
 public virtual void SyncBuffer(IGUIGraphicsBind guibind)
 {
 }