-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
43 lines (40 loc) · 1.64 KB
/
main.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gecarval <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/08/21 16:57:08 by gecarval #+# #+# */
/* Updated: 2024/10/28 09:42:50 by gecarval ### ########.fr */
/* */
/* ************************************************************************** */
#include "./includes/renderer.h"
int main(int argc, char **argv)
{
t_data *data;
data = (t_data *)malloc(sizeof(t_data));
if (!data)
display_error(data, "malloc error\n");
data->winx = WINX;
data->winy = WINY;
if (argc == 3)
data->winx = ft_atoi(argv[1]);
if (argc == 3)
data->winy = ft_atoi(argv[2]);
ft_printf("%s <WINDOW WIDTH> <WINDOW HEIGHT>\n", argv[0]);
ft_init_program(data);
create_gsim(data);
data->anigsim = -1;
data->click_hold = 0;
data->show_tree = -1;
data->show_collision_tree = -1;
data->timing = 0;
water_mark(data);
mlx_mouse_hook(data->win, mouse_click, data);
mlx_hook(data->win, DestroyNotify, 0, exit_data, data);
mlx_key_hook(data->win, mlx_cooked, data);
mlx_loop_hook(data->ini, mlx_anim, data);
mlx_loop(data->ini);
return (0);
}