-
Notifications
You must be signed in to change notification settings - Fork 0
/
key_handle.c
34 lines (31 loc) · 1.29 KB
/
key_handle.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* key_handle.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mmoumni <mmoumni@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/12/26 14:49:22 by mmoumni #+# #+# */
/* Updated: 2022/01/04 12:35:22 by mmoumni ### ########.fr */
/* */
/* ************************************************************************** */
#include "fdf.h"
#include "keys.h"
int close_win(t_fdf *param)
{
mlx_destroy_image(param->mlx_ptr, param->img_ptr);
mlx_destroy_window(param->mlx_ptr, param->win_ptr);
free(param->mlx_ptr);
exit(0);
}
int esc_close(int key, t_fdf *param)
{
if (key == ESC)
{
mlx_destroy_image(param->mlx_ptr, param->img_ptr);
mlx_destroy_window(param->mlx_ptr, param->win_ptr);
free(param->mlx_ptr);
exit(0);
}
return (0);
}