-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkeypress.c
53 lines (48 loc) · 1.48 KB
/
keypress.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* keypress.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: dvan-der <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/12/15 08:23:33 by dvan-der #+# #+# */
/* Updated: 2022/01/28 09:52:47 by dvan-der ### ########.fr */
/* */
/* ************************************************************************** */
#include "fdf.h"
int key_press(int key, void *param)
{
t_fdf *fdf;
fdf = (t_fdf *)param;
if (key == 53)
exit (0);
if (key == 34 || key == 32)
zoom(key, fdf);
else if (key == 123 || key == 124
|| key == 126 || key == 125)
move(key, fdf);
else if (key == 0 || key == 1
|| key == 2 || key == 6
|| key == 13 || key == 14)
rotate(key, fdf);
else if (key == 24 || key == 27)
flatten(key, fdf);
return (0);
}
void make_black(t_fdf *fdf)
{
int i;
int j;
i = 0;
while (i < SCREEN_W)
{
j = 0;
while (j < SCREEN_H)
{
my_mlx_pixel_put(fdf, j, i, 0x00000000);
j++;
}
i++;
}
return ;
}