void fdf(t_p *f) { int i; int c; c = 0; i = 0; f->mlx = mlx_init(); f->win = mlx_new_window(f->mlx, f->h, f->l, "fdf"); drawx(f, 0X00FF00); drawy(f, 0X00FF00); hub(f); mlx_key_hook(f->win, key_funct, 0); mlx_loop(f->mlx); }
void drawx(t_mlx *mlx) { int x; float val; float length; float wall; float deg; x = 0; length = 0; wall = 0; deg = mlx->deg - 30; val = (60 / (float)mlx->w); draw_sky(mlx); draw_floor(mlx); while (x <= mlx->w) { length = line(mlx, 0, deg); wall = mlx->h / length; drawy(mlx, wall, x); deg += val; x++; } }