[client] overlay: move keybinds and config into the overlays

This adds a new `earlyInit` call which allows the overlay to register
options before actually being intialized. Also the keybind handling and
state tracking for each overlay has been moved internal to the overlay
itself.
This commit is contained in:
Geoffrey McRae
2021-08-05 06:40:06 +10:00
parent d90e658e3b
commit 6c84c0eca6
12 changed files with 83 additions and 56 deletions

View File

@@ -83,7 +83,8 @@ void app_glSwapBuffers(void);
#endif
#define MAX_OVERLAY_RECTS 10
void app_registerOverlay(const struct LG_OverlayOps * ops, void * params);
void app_registerOverlay(const struct LG_OverlayOps * ops, const void * params);
void app_initOverlays(void);
void app_setOverlay(bool enable);
bool app_overlayNeedsRender(void);
/**

View File

@@ -31,8 +31,11 @@ struct LG_OverlayOps
/* internal name of the overlay for debugging */
const char * name;
/* called very early to allow for option registration, optional */
void (*earlyInit)(void);
/* called when the overlay is registered */
bool (*init)(void ** udata, void * params);
bool (*init)(void ** udata, const void * params);
/* final free */
void (*free)(void * udata);