public override void SyncBuffer(IGUIGraphicsBind guibind) { if (!m_needUpdateBuffer) { return; } var bind = guibind; bind.SyncDrawTarget(this, m_drawTarget); }
public void Destroy() { m_graphicsBind.Destroy(); m_graphicsBind = null; foreach (var layer in m_layers) { layer.Destroy(); } m_layers.Clear(); }
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; }
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; } } }
public static void Init(IRigelWindowEventHandler eventHandler, IGUIGraphicsBind bind, IFontInfo fontinfo) { Init(new GUIEventHandler(eventHandler), bind, fontinfo); }
public GUIForm(IGUIGraphicsBind bind) { m_graphicsBind = bind; m_layers = new List <GUILayer>(); }
public virtual void SyncBuffer(IGUIGraphicsBind guibind) { }