-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
37 lines (34 loc) · 1.57 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
/* ************************************************************************** */
/* */
/* :::::::: */
/* main.c :+: :+: */
/* +:+ */
/* By: dreijans <dreijans@student.codam.nl> +#+ */
/* +#+ */
/* Created: 2023/05/01 15:42:21 by dreijans #+# #+# */
/* Updated: 2023/05/22 19:58:52 by dreijans ######## odam.nl */
/* */
/* ************************************************************************** */
#include "fractol.h"
int main(int argc, char **argv)
{
t_fractol fractol;
if (argc == 1)
ft_exit("try ./fractol mandelbrot or ./fractol julia nbr nbr", 1);
init(&fractol, argv);
check_input(argc, argv, &fractol);
fractol.mlx = mlx_init(WIDTH, HEIGHT, "MLX42", true);
if (!fractol.mlx)
return (EXIT_FAILURE);
fractol.image = mlx_new_image(fractol.mlx, WIDTH, HEIGHT);
if (!fractol.image)
return (EXIT_FAILURE);
if (mlx_image_to_window(fractol.mlx, fractol.image, 0, 0) == -1)
return (EXIT_FAILURE);
choose(&fractol);
mlx_loop_hook(fractol.mlx, ft_move, &fractol);
mlx_scroll_hook(fractol.mlx, ft_zoom, &fractol);
mlx_loop(fractol.mlx);
mlx_terminate(fractol.mlx);
return (EXIT_SUCCESS);
}