-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
52 lines (47 loc) · 1.5 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/* ************************************************************************** */
/* */
/* :::::::: */
/* main.c :+: :+: */
/* +:+ */
/* By: asulliva <[email protected]> +#+ */
/* +#+ */
/* Created: 2019/04/28 16:03:28 by asulliva #+# #+# */
/* Updated: 2019/05/10 16:42:30 by asulliva ######## odam.nl */
/* */
/* ************************************************************************** */
#include "fdf.h"
#include <fcntl.h>
void init(t_mlx *mlx)
{
t_cam *cam;
cam = (t_cam*)malloc(sizeof(t_cam));
mlx->add_x = 0;
mlx->add_y = 0;
mlx->add_z = 0.75;
mlx->cam = cam;
mlx->cam->alpha = 0;
mlx->cam->beta = 0;
mlx->cam->gamma = 0;
mlx->cam->zoom = 10;
mlx->iso = 0;
if (ft_read(mlx) == -1)
{
ft_putendl("ERROR: INVALID MAP");
return ;
}
handle(mlx);
return ;
}
int main(int ac, char **av)
{
t_mlx mlx;
if (ac == 2)
{
mlx.name = av[1];
mlx.fd = open(mlx.name, O_RDONLY);
mlx.fd != -1 ? init(&mlx) : ft_putendl("ERROR: NOT A VALID FILE");
}
else
ft_putendl("usage: ./fdf [file]");
return (0);
}