diff --git a/client/include/app.h b/client/include/app.h index 6f20de8f..206a062e 100644 --- a/client/include/app.h +++ b/client/include/app.h @@ -103,6 +103,9 @@ typedef struct OverlayGraph * GraphHandle; GraphHandle app_registerGraph(const char * name, RingBuffer buffer, float min, float max); void app_unregisterGraph(GraphHandle handle); +void app_overlayConfigRegister(const char * title, + void (*callback)(void * udata), void * udata); + void app_clipboardRelease(void); void app_clipboardNotifyTypes(const LG_ClipboardData types[], int count); void app_clipboardNotifySize(const LG_ClipboardData type, size_t size); diff --git a/client/renderers/EGL/damage.c b/client/renderers/EGL/damage.c index 3f95c3a9..f396faca 100644 --- a/client/renderers/EGL/damage.c +++ b/client/renderers/EGL/damage.c @@ -26,6 +26,7 @@ #include "app.h" #include "desktop_rects.h" #include "shader.h" +#include "cimgui.h" #include #include @@ -41,7 +42,6 @@ struct EGL_Damage GLfloat transform[6]; bool show; - KeybindHandle toggleHandle; int width , height; float translateX, translateY; @@ -52,10 +52,10 @@ struct EGL_Damage GLint uTransform; }; -void egl_damage_show_toggle(int key, void * opaque) +void egl_damage_config_ui(void * opaque) { EGL_Damage * damage = opaque; - damage->show ^= true; + igCheckbox("Show damage overlay", &damage->show); } bool egl_damage_init(EGL_Damage ** damage) @@ -90,7 +90,7 @@ bool egl_damage_init(EGL_Damage ** damage) } (*damage)->uTransform = egl_shader_get_uniform_location((*damage)->shader, "transform"); - (*damage)->toggleHandle = app_registerKeybind(KEY_A, egl_damage_show_toggle, *damage, "Toggle damage display"); + app_overlayConfigRegister("EGL", egl_damage_config_ui, *damage); return true; } @@ -100,7 +100,6 @@ void egl_damage_free(EGL_Damage ** damage) if (!*damage) return; - app_releaseKeybind(&(*damage)->toggleHandle); egl_desktopRectsFree(&(*damage)->mesh); egl_shader_free(&(*damage)->shader); diff --git a/client/src/app.c b/client/src/app.c index edd013d5..0d78a8e1 100644 --- a/client/src/app.c +++ b/client/src/app.c @@ -860,3 +860,9 @@ void app_setOverlay(bool enable) core_resetOverlayInputState(); } } + +void app_overlayConfigRegister(const char * title, + void (*callback)(void * udata), void * udata) +{ + overlayConfig_register(title, callback, udata); +}