public void Update(RigelGUIEvent e) { GUI.StartGUILayer(this); { actionBeforeUpdate.Invoke(); if (m_syncAll) { if (m_focusedView == null) { //No focused view GUI.SetDrawBuffer(m_bufferRect, m_bufferText); m_bufferRect.Clear(); m_bufferText.Clear(); m_rootView.InternalUpdate(e); m_bufferRect.IsBufferChanged = true; m_bufferText.IsBufferChanged = true; } else { //has focused view //dynamic set buffer GUI.SetDrawBuffer(m_bufferRectDynamic, m_bufferTextDynamic); BufferRectDynamic.Clear(); BufferTextDynamic.Clear(); m_focusedView.InternalUpdate(e, null, true); BufferRectDynamic.IsBufferChanged = true; BufferTextDynamic.IsBufferChanged = true; //normal set buffer GUI.SetDrawBuffer(m_bufferRect, m_bufferText); m_bufferRect.Clear(); m_bufferText.Clear(); m_rootView.InternalUpdate(e, m_focusedView); m_bufferRect.IsBufferChanged = true; m_bufferText.IsBufferChanged = true; } m_syncAll = false; } else { //Update Dynamic if (m_focusedView != null) { GUI.SetDrawBuffer(m_bufferRectDynamic, m_bufferTextDynamic); BufferRectDynamic.Clear(); BufferTextDynamic.Clear(); m_focusedView.InternalUpdate(e, null, true); BufferRectDynamic.IsBufferChanged = true; BufferTextDynamic.IsBufferChanged = true; } } } GUI.EndGUILayer(this); }
public void GenVertexBuffer() { m_bufferData.Clear(); foreach (var list in m_textureStorage.Values) { foreach (var draw in list) { var rect = draw.m_rect; var pos = new Vector4(rect.X, rect.Y, draw.m_depth, 1); var uv = Vector2.Zero; var color = Vector4.One; m_bufferData.AddVertices(pos, color, uv); pos.Y += rect.W; uv.Y = 1; m_bufferData.AddVertices(pos, color, uv); pos.X += rect.Z; uv.X = 1; m_bufferData.AddVertices(pos, color, uv); pos.Y -= rect.W; uv.Y = 0; m_bufferData.AddVertices(pos, color, uv); } } }