diff options
author | Rudy Bousset <rbousset@z2r4p3.le-101.fr> | 2020-01-23 16:16:50 +0100 |
---|---|---|
committer | Rudy Bousset <rbousset@z2r4p3.le-101.fr> | 2020-01-23 16:16:50 +0100 |
commit | 676cdc452bf3f54f0013400fcf6adce9c8990150 (patch) | |
tree | 0b9f7f5a368106e66fa0bda5ff0b4daca1db65f4 /src | |
parent | Trying to close (diff) | |
download | 42-cub3d-676cdc452bf3f54f0013400fcf6adce9c8990150.tar.gz 42-cub3d-676cdc452bf3f54f0013400fcf6adce9c8990150.tar.bz2 42-cub3d-676cdc452bf3f54f0013400fcf6adce9c8990150.tar.xz 42-cub3d-676cdc452bf3f54f0013400fcf6adce9c8990150.tar.zst 42-cub3d-676cdc452bf3f54f0013400fcf6adce9c8990150.zip |
nice
Diffstat (limited to '')
-rw-r--r-- | src/ft_init_lists.c | 27 | ||||
-rw-r--r-- | src/ft_parse_map.c | 8 | ||||
-rw-r--r-- | src/main.c | 18 |
3 files changed, 45 insertions, 8 deletions
diff --git a/src/ft_init_lists.c b/src/ft_init_lists.c new file mode 100644 index 0000000..c61dd45 --- /dev/null +++ b/src/ft_init_lists.c @@ -0,0 +1,27 @@ +#include <libft.h> +#include <mlx.h> +#include <cub3d.h> +#include <stdlib.h> + +t_winlist +*ft_init_winlist(void) +{ + t_winlist *wlist; + + wlist = (t_winlist*)malloc(sizeof(t_winlist)); + wlist->x_size = 800; + wlist->y_size = 600; + wlist->wlx = mlx_init(); + wlist->winptr = (void*)malloc(800 * 600); + wlist->winptr = mlx_new_window(wlist->wlx, 800, 600, "Cub3D"); + return (wlist); +} + +t_cublist +*ft_init_cublist(void) +{ + t_cublist *clist; + + clist = (t_cublist*)malloc(sizeof(t_cublist)); + return (clist); +} diff --git a/src/ft_parse_map.c b/src/ft_parse_map.c new file mode 100644 index 0000000..b600849 --- /dev/null +++ b/src/ft_parse_map.c @@ -0,0 +1,8 @@ +#include <libft.h> +#include <cub3d.h> +#include <stdlib.h> + +void +ft_parse_map(t_cublist *clist) +{ +} @@ -1,18 +1,20 @@ #include <libft.h> #include <mlx.h> +#include <cub3d.h> #include <stdlib.h> int main(void) { - void *win; - void *winptr; + t_winlist *wlist; + t_cublist *clist; - win = mlx_init(); - winptr = (void*)malloc(800 * 600); - winptr = mlx_new_window(win, 800, 600, "Cub3d"); - mlx_loop(win); - free(winptr); - free(win); + wlist = ft_init_winlist(); + clist = ft_init_cublist(); + mlx_loop(wlist->wlx); + ft_memdel(wlist->wlx); + ft_memdel(wlist->winptr); + ft_memdel(wlist); + ft_memdel(clist); return (0); } |