diff options
Diffstat (limited to 'event.c')
| -rw-r--r-- | event.c | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -6,7 +6,7 @@ /* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/11/15 06:39:37 by cacharle #+# #+# */ -/* Updated: 2020/01/16 07:52:01 by cacharle ### ########.fr */ +/* Updated: 2020/01/17 13:59:48 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ @@ -15,12 +15,8 @@ #define ROTATE_STEP (M_PI / 20.0) #define MOVE_SPEED 0.25 -int event_keydown(int key, void *param) +int event_keydown(int key, t_state *state) { - t_state *state; - - printf("event: %d\n", key); - state = (t_state*)param; if (key == MLXK_ESC) state->running = FALSE; else if (key == MLXK_A) @@ -41,3 +37,8 @@ int event_keydown(int key, void *param) helper_rotate_player(state, ROTATE_STEP); return (0); } + +int event_quit(t_state *state) +{ + state->running = FALSE; +} |
