input (kinda) works, close #7

This commit is contained in:
NishiOwO 2025-04-20 18:15:54 +09:00
parent 6095b0ec62
commit ae3d005671
No known key found for this signature in database
GPG Key ID: 27EF69B208EB9343
3 changed files with 3 additions and 3 deletions

View File

@ -82,7 +82,7 @@ gf_gui_id_t button1 = -1;
gf_gui_id_t button2 = -1;
void gf_button_callback(gf_engine_t* engine, gf_draw_t* draw, gf_gui_id_t id, int type) {
if(type == GF_GUI_PRESS) {
if(type == GF_GUI_PRESS_EVENT) {
gf_log_function(engine, "GUI component %d was pressed", id);
}
}

View File

@ -130,7 +130,7 @@ void gf_gui_render(gf_gui_t* gui) {
}
if((gui->pressed != -1) && !(input->mouse_flag & GF_INPUT_MOUSE_LEFT_MASK)) {
if(gui->area[gui->pressed].callback != NULL) {
gui->area[gui->pressed].callback(gui->engine, gui->draw, gui->pressed, GF_GUI_PRESS);
gui->area[gui->pressed].callback(gui->engine, gui->draw, gui->pressed, GF_GUI_PRESS_EVENT);
}
gui->area[gui->pressed].pressed = 1;
gui->pressed = -1;

View File

@ -21,7 +21,7 @@ typedef int gf_gui_id_t;
* @brief GUI events
*/
enum GF_GUI_EVENTS {
GF_GUI_PRESS = 0
GF_GUI_PRESS_EVENT = 0
};
#ifdef GF_EXPOSE_GUI