From d1097088999c538601158805cf77250d51513f98 Mon Sep 17 00:00:00 2001 From: Rudy Bousset Date: Wed, 5 Feb 2020 13:32:40 +0100 Subject: Don't mess with me boy --- src/ft_get_screen_size.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/ft_get_screen_size.c (limited to 'src/ft_get_screen_size.c') diff --git a/src/ft_get_screen_size.c b/src/ft_get_screen_size.c new file mode 100644 index 0000000..cd9b162 --- /dev/null +++ b/src/ft_get_screen_size.c @@ -0,0 +1,16 @@ +#include +#include + +int8_t +ft_get_screen_size(t_win *wlist) +{ + char **words; + + if (!(words = ft_split(FT_SCR_SIZE, 'x'))) + return (-1); + if (!(*words + 0) || !(*(words + 1)) || (*(words + 2))) + return (-1); + wlist->x_max_size = ft_atoi(words[0]); + wlist->y_max_size = ft_atoi(words[1]); + return (ft_free_words(words)); +} -- cgit v1.2.3