Beispiel #1
0
        public static void Draw(this PerfNode node, int depth)
        {
            bool collapse = ImGuiNET.ImGui.TreeNodeEx(node.label, ImGuiTreeNodeFlags.Framed | ImGuiTreeNodeFlags.FramePadding);

            if (!node.IsRoot)
            {
                ImGuiNET.ImGui.SameLine(400);
                ImGuiNET.ImGui.Text(string.Format("{0:D}", node.count)); ImGuiNET.ImGui.SameLine(500);
                ImGuiNET.ImGui.Text(string.Format("{0:F4}", node.averageMS)); ImGuiNET.ImGui.SameLine(600);
                ImGuiNET.ImGui.Text(string.Format("{0:P1}%%", node.percent)); ImGuiNET.ImGui.SameLine(800);
                ImGuiNET.ImGui.Text(string.Format("{0:P1}%%", node.totalPercent));
            }

            if (depth < 3 && !collapse)
            {
                ImGuiNET.ImGui.TreePush();
            }

            if (collapse || depth < 3)
            {
                foreach (var c in node.children)
                {
                    c.Draw(depth + 1);
                }

                ImGuiNET.ImGui.TreePop();
            }
        }
Beispiel #2
0
        public bool HasChild(PerfNode node)
        {
            foreach (var c in children)
            {
                if (node == c)
                {
                    return(true);
                }
            }

            return(false);
        }
Beispiel #3
0
 public PerfNode GetNode(ThreadedProfiler profiler, PerfNode parent, int id)
 {
     ref Block block = ref profiler.Blocks.At(id);
Beispiel #4
0
 public void Reset(string label, PerfTree profiler, PerfNode parent)
 {
     this.label    = label;
     this.profiler = profiler;
     this.parent   = parent;
 }