feat: input handler
This commit is contained in:
parent
3abc6cbfd6
commit
78a6bbbb68
5 changed files with 87 additions and 4 deletions
|
|
@ -6,7 +6,7 @@
|
|||
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/02/26 15:26:13 by mcolonna #+# #+# */
|
||||
/* Updated: 2024/03/08 13:54:52 by mcolonna ### ########.fr */
|
||||
/* Updated: 2024/03/26 13:20:06 by mcolonna ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -26,6 +26,11 @@ typedef struct s_env
|
|||
void *mlx;
|
||||
void *win;
|
||||
t_room room;
|
||||
|
||||
bool up;
|
||||
bool down;
|
||||
bool left;
|
||||
bool right;
|
||||
} t_env;
|
||||
|
||||
extern t_env g_env;
|
||||
|
|
|
|||
20
includes/input.h
Normal file
20
includes/input.h
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* input.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/03/26 12:16:32 by mcolonna #+# #+# */
|
||||
/* Updated: 2024/03/26 13:26:27 by mcolonna ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifndef INPUT_H
|
||||
# define INPUT_H
|
||||
|
||||
void input_init(void);
|
||||
int key_press_hook(int keycode);
|
||||
int key_release_hook(int keycode);
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue