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

@@ -46,16 +46,14 @@ OverlayConfig;
static OverlayConfig cfg = { 0 };
static bool config_init(void ** udata, const void * params)
static void config_earlyInit(void)
{
cfg.callbacks = ll_new();
cfg.tabCallbacks = ll_new();
if (!cfg.callbacks)
{
DEBUG_ERROR("failed to allocate ram");
return false;
}
}
static bool config_init(void ** udata, const void * params)
{
return true;
}
@@ -239,6 +237,7 @@ static int config_render(void * udata, bool interactive, struct Rect * windowRec
struct LG_OverlayOps LGOverlayConfig =
{
.name = "Config",
.earlyInit = config_earlyInit,
.init = config_init,
.free = config_free,
.render = config_render