[client] imgui: support registering new graphs

Currently, our struct ll doesn't support removing elements from the middle,
so we will not be removing anything for now.
This commit is contained in:
Quantum
2021-07-17 22:31:11 -04:00
committed by Geoffrey McRae
parent a4bf3c8088
commit 15bc6a1509
4 changed files with 68 additions and 54 deletions

View File

@@ -720,10 +720,15 @@ static int lg_run(void)
ImFontAtlas_GetTexDataAsRGBA32(g_state.io->Fonts, &text_pixels,
&text_w, &text_h, NULL);
g_state.graphs = ll_new();
// initialize metrics ringbuffers
g_state.renderTimings = ringbuffer_new(256, sizeof(float));
g_state.frameTimings = ringbuffer_new(256, sizeof(float));
app_registerGraph("RENDER", g_state.renderTimings);
app_registerGraph("UPLOAD", g_state.frameTimings);
// search for the best displayserver ops to use
for(int i = 0; i < LG_DISPLAYSERVER_COUNT; ++i)
if (LG_DisplayServers[i]->probe())