-
Notifications
You must be signed in to change notification settings - Fork 0
/
hooks.c
34 lines (30 loc) · 1.18 KB
/
hooks.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* hooks.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mehtel <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/03/23 19:07:45 by mehtel #+# #+# */
/* Updated: 2021/03/23 19:08:39 by mehtel ### ########.fr */
/* */
/* ************************************************************************** */
#include "cub3d.h"
int release_hook(int button, t_vars *vars)
{
vars->btns[button] = 0;
return (button);
}
int press_hook(int button, t_vars *vars)
{
if (button == ESC_BUTTON)
vars->exit = 1;
else
vars->btns[button] = 1;
return (button);
}
int mouse_hook(t_vars *vars)
{
vars->exit = 1;
return (1);
}