overlay: move init/free to the context of the render thread

This is done to allow overlays to make use of the renderer during
init/free.
This commit is contained in:
Geoffrey McRae
2022-05-26 00:40:13 +10:00
parent c737b12a3b
commit 8aa36144dc
6 changed files with 29 additions and 18 deletions

View File

@@ -70,9 +70,13 @@ static void showTimingKeybind(int sc, void * opaque)
app_invalidateWindow(false);
}
static bool graphs_init(void ** udata, const void * params)
static void graphs_earlyInit(void)
{
gs.graphs = ll_new();
}
static bool graphs_init(void ** udata, const void * params)
{
app_overlayConfigRegister("Performance Metrics", configCallback, NULL);
app_registerKeybind(KEY_T, showTimingKeybind, NULL,
"Show frame timing information");
@@ -207,6 +211,7 @@ static int graphs_render(void * udata, bool interactive,
struct LG_OverlayOps LGOverlayGraphs =
{
.name = "Graphs",
.earlyInit = graphs_earlyInit,
.init = graphs_init,
.free = graphs_free,
.render = graphs_render