void check_arg(char **av, t_img *img, t_frac *frac) { if (av[2]) frac->max_iter = ft_atoi(av[2]); init_color(frac, av); if (ft_strequ(av[1], "mandel") == 1) { set_mandel(frac); draw_mandelbrot(img, frac); } else if (ft_strequ(av[1], "julia") == 1) { set_julia(frac); draw_julia(img, frac); } else if (ft_strequ(av[1], "ship") == 1) { set_ship(frac); draw_ship(img, frac); } else if (ft_strequ(av[1], "triangle") == 1) { set_triangle(frac); draw_sierpinski(img, frac); } else exit(0); }
int mouse_motion_hook(int x, int y, t_mlx *mlx) { t_mand mand; t_julia ju; if (mlx->motion == 1) { mlx->add = mlx_get_data_addr(mlx->new_img, &mlx->bpp, &mlx->s_l, &mlx->edn); mlx->x = x; mlx->y = y; if (mlx->choice == 1) choice_one(mlx); if (mlx->choice == 2) { set_mandelbrot(&mand); mandelbrot(mlx, &mand); } if (mlx->choice == 3) { set_julia(&ju, mlx); manu(mlx, &ju); } mlx_put_image_to_window(mlx->init, mlx->win, mlx->new_img, 0, 0); } return (0); }
static void choice_one(t_mlx *mlx) { t_julia ju; set_julia(&ju, mlx); julia(mlx, &ju); }
static void choice(t_mlx *mlx) { t_julia ju; t_mand mand; mlx->add = mlx_get_data_addr(mlx->new_img, &mlx->bpp, &mlx->s_l, &mlx->edn); if (mlx->choice == 2) { set_mandelbrot(&mand); mandelbrot(mlx, &mand); } else if (mlx->choice == 1) { set_julia(&ju, mlx); julia(mlx, &ju); } else { set_manu(&ju, mlx); manu(mlx, &ju); } mlx_put_image_to_window(mlx->init, mlx->win, mlx->new_img, 0, 0); }