private void DisposeUI(UIRenderer uiRenderer) { uiRenderer.Dispose(); UIRenderer[] array = uiRenderer.Children.ToArray(); foreach (UIRenderer child in array) { DisposeUI(child); } }
private void DisposeUI(UIRenderer uiRenderer) { uiRenderer.Dispose(); ITreeNode[] array = uiRenderer.Children.ToArray(); foreach (ITreeNode child in array) { DisposeUI(child as UIRenderer); } }
/// <summary> /// Gets projection matrix for <see cref="ILayout<T>"/> to layout controls in OpenGL canvas. /// </summary> /// <param name="uiRenderer"></param> /// <returns></returns> public static mat4 GetOrthoProjection(this UIRenderer uiRenderer) { float halfWidth = uiRenderer.Size.Width / 2.0f; float halfHeight = uiRenderer.Size.Height / 2.0f; //float halfDepth = Math.Max(halfWidth, halfHeight); //halfDepth = Math.Max(halfDepth, Math.Abs(uiRenderer.zNear)); //halfDepth = Math.Max(halfDepth, Math.Abs(uiRenderer.zFar)); return(glm.ortho(-halfWidth, halfWidth, -halfHeight, halfHeight, uiRenderer.zNear, uiRenderer.zFar)); }
//#if DEBUG // private int stackLevel = 0; //#endif private void RenderUIRenderer(UIRenderer renderer, RenderEventArgs arg) { //#if DEBUG // stackLevel++; // if (stackLevel > ushort.MaxValue) // { throw new Exception(string.Format("Maybe circular reference in UI tree!")); } //#endif renderer.Render(arg); foreach (var item in renderer.Children) { RenderUIRenderer(item, arg); } //#if DEBUG // stackLevel--; //#endif }
//#if DEBUG // private int stackLevel = 0; //#endif private void RenderUIRenderer(UIRenderer renderer, RenderEventArgs arg) { //#if DEBUG // stackLevel++; // if (stackLevel > ushort.MaxValue) // { throw new Exception(string.Format("Maybe circular reference in UI tree!")); } //#endif renderer.Render(arg); UIRenderer[] array = renderer.Children.ToArray(); foreach (UIRenderer item in array) { RenderUIRenderer(item, arg); } //#if DEBUG // stackLevel--; //#endif }