Cub3D
Loading...
Searching...
No Matches
hook_functions.c
1/* ************************************************************************** */
2/* */
3/* ::: :::::::: */
4/* hook_functions.c :+: :+: :+: */
5/* +:+ +:+ +:+ */
6/* By: kamitsui <kamitsui@student.42tokyo.jp> +#+ +:+ +#+ */
7/* +#+#+#+#+#+ +#+ */
8/* Created: 2024/10/09 03:21:16 by kamitsui #+# #+# */
9/* Updated: 2024/12/21 11:10:30 by kamitsui ### ########.fr */
10/* */
11/* ************************************************************************** */
12
13#include "cub3d.h"
14
15int handle_key_press(int keycode, t_game *game)
16{
17 static t_handle_key_press func[ENUM_OTHER + 1] = {
18 quit_game, set_move_forward_flag, set_move_backward_flag,
19 set_strafe_left_flag, set_strafe_right_flag,
20 set_rotate_left_flag, set_rotate_right_flag, invalid_key};
21 int i;
22
23 i = 0;
24 while (i < ENUM_OTHER + 1)
25 {
26 func[i](keycode, game);
27 i++;
28 }
29 return (EXIT_SUCCESS);
30}
31
32int handle_mouse(int button, int x, int y, t_game *game)
33{
34 (void)button;
35 (void)x;
36 (void)y;
37 (void)game;
38 return (EXIT_SUCCESS);
39}
40//debug code
41// if (IS_DEBUG == false)
42// return (EXIT_FAILURE);
43// ft_printf("mouse[%d] x[%d] y[%d]\n", button, x, y);
44// fd = STDOUT_FILENO -> game->debug.fd ... out to debug.log
main game
Definition type_cub3d.h:264