[client] egl: refactor config dialog into main egl module

This will allow other things like scaling to be implemented.
This commit is contained in:
Quantum 2021-08-06 03:23:49 -04:00 committed by Geoffrey McRae
parent 5b26017a8a
commit dc7fd74327
3 changed files with 10 additions and 3 deletions

View File

@ -52,9 +52,8 @@ struct EGL_Damage
GLint uTransform;
};
void egl_damage_config_ui(void * opaque)
void egl_damage_config_ui(EGL_Damage * damage)
{
EGL_Damage * damage = opaque;
igCheckbox("Show damage overlay", &damage->show);
}
@ -90,7 +89,6 @@ bool egl_damage_init(EGL_Damage ** damage)
}
(*damage)->uTransform = egl_shader_get_uniform_location((*damage)->shader, "transform");
app_overlayConfigRegister("EGL", egl_damage_config_ui, *damage);
return true;
}

View File

@ -36,6 +36,7 @@ typedef struct EGL_Damage EGL_Damage;
bool egl_damage_init(EGL_Damage ** damage);
void egl_damage_free(EGL_Damage ** damage);
void egl_damage_config_ui(EGL_Damage * damage);
void egl_damage_setup(EGL_Damage * damage, int width, int height);
void egl_damage_resize(EGL_Damage * damage, float translateX, float translateY,
float scaleX, float scaleY);

View File

@ -613,6 +613,12 @@ static void debugCallback(GLenum source, GLenum type, GLuint id,
DEBUG_PRINT(level, "GL message (source: %s, type: %s): %s", sourceName, typeName, message);
}
static void egl_config_ui(void * opaque)
{
struct Inst * this = opaque;
egl_damage_config_ui(this->damage);
}
static bool egl_render_startup(void * opaque, bool useDMA)
{
struct Inst * this = (struct Inst *)opaque;
@ -814,6 +820,8 @@ static bool egl_render_startup(void * opaque, bool useDMA)
return false;
}
app_overlayConfigRegister("EGL", egl_config_ui, this);
this->imgui = true;
return true;
}