diff options
author | 2025-05-20 20:23:59 +0200 | |
---|---|---|
committer | 2025-05-20 20:25:31 +0200 | |
commit | 693d830f69b9a4ce6f956f4a688f41180156473e (patch) | |
tree | c15764d1e95291b32ca9af41daf4dd41290544a7 /src/main/game | |
parent | 618402caa489751d61643e6839607fd1546ad635 (diff) | |
download | tris-693d830f69b9a4ce6f956f4a688f41180156473e.tar.gz tris-693d830f69b9a4ce6f956f4a688f41180156473e.zip |
Add logic to get coordinates of the mouse button click
Diffstat (limited to 'src/main/game')
-rw-r--r-- | src/main/game/game.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main/game/game.c b/src/main/game/game.c index 0aa4888..2bd0bb5 100644 --- a/src/main/game/game.c +++ b/src/main/game/game.c @@ -17,12 +17,19 @@ * along with Tris Game. If not, see <http://www.gnu.org/licenses/>. */ +#include <stdio.h> #include <stdlib.h> #include "../engine/engine.h" #include "game.h" #include "../util.h" #include "../engine/ui/ui.h" +static void +game_mouse_button_pressed(int x, int y) +{ + printf("mouse pressed %d %d\n", x, y); +} + TrisGame * game_init(int width, int height) { @@ -33,6 +40,7 @@ game_init(int width, int height) } engine_init(width, height); ui_set_title("Tris Game"); + engine_set_mouse_button_listener(game_mouse_button_pressed); game_draw_field(0.5, 0, 0); |