From 4a07369a67e3f88417ac4a309852eadaf40f23d4 Mon Sep 17 00:00:00 2001 From: salaaad2 Date: Fri, 21 Feb 2020 19:31:27 +0100 Subject: add threaded music --- src/main.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 52bb211..ededacf 100644 --- a/src/main.c +++ b/src/main.c @@ -15,17 +15,30 @@ #include #include #include +#include +#include + +void + *ft_zik(void *vargp) +{ + (void)vargp; + system("afplay revelations.mp3"); + return NULL; +} int main(int argc, const char *argv[]) { t_cub *clist; + pthread_t thread_id; if (argc < 2) { ft_dprintf(STDERR_FILENO, "Error\n\033[1;31mNo map selected\n\033[0m"); return (1); } + pthread_create(&thread_id, NULL, ft_zik, NULL); + pthread_join(thread_id, NULL); if (ft_init_cub3d(&clist) < 0) return (2); ft_parse_map(argv[1], clist); -- cgit v1.2.3