From ae3d005671297372c46867434726e0d72442e952 Mon Sep 17 00:00:00 2001 From: NishiOwO Date: Sun, 20 Apr 2025 18:15:54 +0900 Subject: [PATCH] input (kinda) works, close #7 --- engine/gf_draw_common.c | 2 +- engine/gf_gui.c | 2 +- engine/include/gf_type/gui.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/engine/gf_draw_common.c b/engine/gf_draw_common.c index 2d6a104..c2fe8b1 100644 --- a/engine/gf_draw_common.c +++ b/engine/gf_draw_common.c @@ -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); } } diff --git a/engine/gf_gui.c b/engine/gf_gui.c index ffd0b4c..3ed1524 100644 --- a/engine/gf_gui.c +++ b/engine/gf_gui.c @@ -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; diff --git a/engine/include/gf_type/gui.h b/engine/include/gf_type/gui.h index facabad..82ebd53 100644 --- a/engine/include/gf_type/gui.h +++ b/engine/include/gf_type/gui.h @@ -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