added cross click
This commit is contained in:
parent
b593057cd5
commit
33b3b06c07
3 changed files with 12 additions and 8 deletions
5
algo.c
5
algo.c
|
@ -6,7 +6,7 @@
|
|||
/* By: grobledo <grobledo@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/10/01 16:24:58 by grobledo #+# #+# */
|
||||
/* Updated: 2024/10/29 14:23:34 by grobledo ### ########.fr */
|
||||
/* Updated: 2024/10/29 14:33:28 by grobledo ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -77,8 +77,6 @@ static int loop_hook(void *param)
|
|||
return (0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
g_mlx = mlx_init();
|
||||
|
@ -93,6 +91,7 @@ int main(int argc, char *argv[])
|
|||
g_win = mlx_new_window(g_mlx, SCREEN_WIDTH, SCREEN_HEIGHT, "cub3d");
|
||||
mlx_hook(g_win, KeyPress, KeyPressMask, keypress, NULL);
|
||||
mlx_hook(g_win, KeyRelease, KeyReleaseMask, keyrelease, NULL);
|
||||
mlx_hook(g_win, 17, 1L<<17, ft_exit, NULL);
|
||||
mlx_loop_hook(g_mlx, loop_hook, NULL);
|
||||
draw_screen();
|
||||
mlx_loop(g_mlx);
|
||||
|
|
9
input.c
9
input.c
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* input.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: mcolonna <mcolonna@student.42.fr> +#+ +:+ +#+ */
|
||||
/* By: grobledo <grobledo@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/10/17 14:43:36 by mcolonna #+# #+# */
|
||||
/* Updated: 2024/10/17 16:05:50 by mcolonna ### ########.fr */
|
||||
/* Updated: 2024/10/29 14:32:46 by grobledo ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -50,3 +50,8 @@ void input_init(void)
|
|||
g_input_actions.right = false;
|
||||
g_input_actions.quit = false;
|
||||
}
|
||||
int ft_exit(void)
|
||||
{
|
||||
g_input_actions.quit = true;
|
||||
return(0);
|
||||
}
|
6
input.h
6
input.h
|
@ -3,10 +3,10 @@
|
|||
/* ::: :::::::: */
|
||||
/* input.h :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: mcolonna <mcolonna@student.42.fr> +#+ +:+ +#+ */
|
||||
/* By: grobledo <grobledo@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/10/17 14:43:09 by mcolonna #+# #+# */
|
||||
/* Updated: 2024/10/17 14:59:41 by mcolonna ### ########.fr */
|
||||
/* Updated: 2024/10/29 14:33:04 by grobledo ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -31,5 +31,5 @@ extern t_input_actions g_input_actions;
|
|||
int keypress(int keycode);
|
||||
int keyrelease(int keycode);
|
||||
void input_init(void);
|
||||
|
||||
int ft_exit(void);
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue