mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-10 08:38:20 +00:00
[client] egl: use a ui switch for damage display instead of a keybind
This commit is contained in:
parent
f3f0157d3c
commit
6c44bbb53e
@ -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);
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include "app.h"
|
||||
#include "desktop_rects.h"
|
||||
#include "shader.h"
|
||||
#include "cimgui.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user