tmp push merge resolution not finished
This commit is contained in:
parent
2568aa69a6
commit
00dc0e9e67
16 changed files with 454 additions and 59 deletions
38
mlx_layer/hooks.c
Normal file
38
mlx_layer/hooks.c
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* hooks.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: bgoulard <bgoulard@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/11/28 14:12:25 by bgoulard #+# #+# */
|
||||
/* Updated: 2024/11/28 14:57:01 by bgoulard ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "cub3d.h"
|
||||
#include "cub3d_struct.h"
|
||||
|
||||
#include "mlx_functions.h"
|
||||
|
||||
#include <X11/keysym.h>
|
||||
|
||||
int key_hook(int keycode, t_info *data)
|
||||
{
|
||||
if (keycode == XK_Escape)
|
||||
mlx_loop_end(data->mlx_ptr);
|
||||
if (keycode == XK_w)
|
||||
move_straight(data);
|
||||
if (keycode == XK_s)
|
||||
move_backward(data);
|
||||
if (keycode == XK_a)
|
||||
move_right(data);
|
||||
if (keycode == XK_d)
|
||||
move_left(data);
|
||||
if (keycode == XK_Left)
|
||||
look_left(data);
|
||||
if (keycode == XK_Right)
|
||||
look_right(data);
|
||||
return (0);
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue