mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-12-29 16:02:29 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user