From 676cdc452bf3f54f0013400fcf6adce9c8990150 Mon Sep 17 00:00:00 2001 From: Rudy Bousset Date: Thu, 23 Jan 2020 16:16:50 +0100 Subject: nice --- src/ft_init_lists.c | 27 +++++++++++++++++++++++++++ src/ft_parse_map.c | 8 ++++++++ src/main.c | 18 ++++++++++-------- 3 files changed, 45 insertions(+), 8 deletions(-) create mode 100644 src/ft_init_lists.c create mode 100644 src/ft_parse_map.c (limited to 'src') 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 +#include +#include +#include + +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 +#include +#include + +void +ft_parse_map(t_cublist *clist) +{ +} diff --git a/src/main.c b/src/main.c index 6927b6d..16c96ef 100644 --- a/src/main.c +++ b/src/main.c @@ -1,18 +1,20 @@ #include #include +#include #include 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); } -- cgit v1.2.3