From d812df80d26f879d4d49ec45453866574e995839 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Mon, 2 Mar 2020 00:56:03 +0100 Subject: trying to thread --- src/ft_treat_args.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/ft_treat_args.c') diff --git a/src/ft_treat_args.c b/src/ft_treat_args.c index aee2776..cc1391a 100644 --- a/src/ft_treat_args.c +++ b/src/ft_treat_args.c @@ -12,7 +12,9 @@ #include #include +#include #include +#include #include uint8_t @@ -30,12 +32,18 @@ uint8_t uint8_t ft_use_args(int argc, const char *argv[], t_cub *clist) { + pthread_t tid; + if (argc < 3) { if (ft_init_winptr(clist) < 0) return (ft_exit(FT_RET_FAILED_MLX, clist)); ft_draw_scene(clist); - /* ft_music(clist); */ + if (clist->mlist->ismusic) + { + pthread_create(&tid, NULL, ft_music, clist); + pthread_join(tid, NULL); + } ft_hooks_and_loops(clist->wlist, clist); } else if (argc == 3 && !ft_strncmp("--save", argv[2], 7)) -- cgit v1.2.3