int main(int argc, char **argv) { if (argc == 2) ft_fdf(argv[1], 0, 0, 1); else if (argc == 5) ft_fdf(argv[1], ft_atoi(argv[2]), ft_atoi(argv[3]), ft_atoi(argv[4])); else { ft_putstr("ERROR X100 : 4 arguements asked \n"); ft_putstr("Exemple : 'prog.mlx 1800 1800 1'"); ft_putendl(" or asked at Barbare for more help :)"); } return (0); }
int main(int ac, char **av, char **environ) { t_env env; int fd; int j; j = 0; fd = 0; if (!environ[0]) return (-1); ft_init_env(&env); if (ac == 2) { env.len_y = ft_tab_len(fd, &j, av[1]); if (env.len_y == 0 && j == 0) return (-1); env.grid = ft_mallogrid(env.grid, env.len_y, j); if (!env.grid) return (-1); if ((fd = open(av[1], O_RDONLY)) == -1) return (-1); env.grid = ft_writegrid(env.grid, fd, &env); if (close(fd) == -1) return (-1); ft_fdf(&env); } return (0); }
int ft_fdf_event(int keycode, t_fdf *fdf) { if (keycode == 53) ft_fdf_exit(fdf); fdf->key = keycode; ft_fdf(fdf); return (0); }
int main (int argc, char **argv) { t_mlx *mlx; mlx = ft_mlx_init(); ft_fdf(mlx, argv); printf("F**k tha police"); argc = 0; printf("F**k tha police"); mlx_key_hook(mlx->win, mlx_key_press, mlx); mlx_loop(mlx->mlx); return (0); }
void ft_pre_fdf(t_array *array) { t_fdf *fdf; t_mlx *mlx; mlx = NULL; fdf = NULL; mlx = ft_mlx_init(mlx, 800, 800, "FDF"); fdf = ft_init_fdf(mlx, array); ft_fdf(fdf); mlx_hook(mlx->p_win, KeyPress, KeyPressMask, ft_fdf_event, fdf); mlx_loop(fdf->mlx); }
int main(int ac, char **av) { int **tab; int fd; if (ac == 2) { fd = open(av[1], O_RDONLY); tab = ft_getnbr(fd); ft_fdf(tab); } else if (ac < 2) ft_putstr("Rien a lire.\n"); else ft_putstr("Trop de maps !\n"); return (0); }