| 115 | } |
| 116 | |
| 117 | void DrawGraphs() |
| 118 | { |
| 119 | #if !WINDOWS_UWP |
| 120 | ulong memPollIdx = (ulong)(Time.Total * 2); |
| 121 | if (lastMemPoll != memPollIdx) |
| 122 | { |
| 123 | lastMemPoll = memPollIdx; |
| 124 | using (Process process = Process.GetCurrentProcess()) |
| 125 | { |
| 126 | long managedMem = GC.GetTotalMemory(false); |
| 127 | long workingMem = process.WorkingSet64; |
| 128 | ramGraph .Add(workingMem / (1024.0f * 1024.0f)); |
| 129 | managedRamGraph.Add(managedMem / (1024.0f * 1024.0f)); |
| 130 | } |
| 131 | } |
| 132 | #endif |
| 133 | |
| 134 | float thirdWidth = (UI.LayoutRemaining.x - UI.Settings.gutter*2) / 3.0f; |
| 135 | Vec2 graphSize = V.XY(thirdWidth, UI.LineHeight); |
| 136 | |
| 137 | fpsGraph.Add(Time.Stepf*1000); |
| 138 | fpsGraph.Draw(styleGraph, "Frame (ms)", UI.LayoutAt + V.XYZ(0,0,-0.004f), graphSize); |
| 139 | UI.LayoutReserve(graphSize); |
| 140 | UI.SameLine(); |
| 141 | |
| 142 | managedRamGraph.Draw(styleGraph, "Managed (mb)", UI.LayoutAt + V.XYZ(0,0,-0.004f), graphSize); |
| 143 | UI.LayoutReserve(graphSize); |
| 144 | UI.SameLine(); |
| 145 | |
| 146 | ramGraph.Draw(styleGraph, "Total (mb)", UI.LayoutAt + V.XYZ(0, 0, -0.004f), graphSize); |
| 147 | UI.LayoutReserve(graphSize); |
| 148 | } |
| 149 | |
| 150 | struct DiagGraph |
| 151 | { |