-
Notifications
You must be signed in to change notification settings - Fork 0
/
fractol.c
89 lines (79 loc) · 1.93 KB
/
fractol.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* fractol.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rlechapt <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2015/01/07 18:35:56 by rlechapt #+# #+# */
/* Updated: 2015/03/03 11:02:13 by rlechapt ### ########.fr */
/* */
/* ************************************************************************** */
#include "fractol.h"
void mdlb_init(void)
{
t_env e;
e.flag = 1;
e.zoom = 0.5;
e.movex = 0;
e.movey = 0;
e.width = 600;
e.height = 600;
e.iter_max = 100;
mlx_settings(&e);
}
void jlia_init(void)
{
t_env e;
e.flag = 2;
e.zoom = 0.5;
e.movex = 0;
e.movey = 0;
e.width = 600;
e.height = 600;
e.iter_max = 150;
mlx_settings(&e);
}
void bdha_init(void)
{
t_env e;
e.flag = 3;
e.zoom = 0.5;
e.movex = 0;
e.movey = 0;
e.width = 600;
e.height = 600;
e.iter_max = 100;
mlx_settings(&e);
}
int print_param(void)
{
ft_putendl("chose a fractal parameter:");
ft_putendl(" _mandelbrot");
ft_putendl(" _julia");
ft_putendl(" _mandelbar");
return (0);
}
int main(int argc, char **argv)
{
char *mdlb;
char *jlia;
char *mdlr;
mdlb = "mandelbrot";
jlia = "julia";
mdlr = "mandelbar";
if (argc != 2)
return (print_param());
else
{
if (ft_strcmp(argv[1], mdlb) == 0)
mdlb_init();
else if (ft_strcmp(argv[1], jlia) == 0)
jlia_init();
else if (ft_strcmp(argv[1], mdlr) == 0)
bdha_init();
else
return (print_param());
}
return (0);
}