-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
38 lines (35 loc) · 1.41 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ana-lda- <ana-lda-@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/08/03 16:33:35 by ana-lda- #+# #+# */
/* Updated: 2024/08/12 16:13:19 by ana-lda- ### ########.fr */
/* */
/* ************************************************************************** */
#include "fractol.h"
int main(int argc, char **argv)
{
t_fractal fractal;
if ((argc == 2 && !ft_strncmp(argv[1], "mandelbrot", 10))
|| (argc == 4 && !valid_input(argc, argv)
&& !ft_strncmp(argv[1], "julia", 5)))
{
fractal.name = argv[1];
if (!ft_strncmp(argv[1], "julia", 5))
{
fractal.julia_x = ft_atodbl(argv[2]);
fractal.julia_y = ft_atodbl(argv[3]);
}
fractal_init(&fractal);
fractal_render(&fractal);
mlx_loop(fractal.mlx_connection);
}
else
{
putstr_fd(ERROR_MESSAGE, STDERR_FILENO);
exit(EXIT_FAILURE);
}
}