diff options
Diffstat (limited to 'minilibx-linux/mlx_screen_size.c')
-rw-r--r-- | minilibx-linux/mlx_screen_size.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/minilibx-linux/mlx_screen_size.c b/minilibx-linux/mlx_screen_size.c new file mode 100644 index 0000000..835730d --- /dev/null +++ b/minilibx-linux/mlx_screen_size.c @@ -0,0 +1,13 @@ +#include "mlx_int.h" + +int mlx_get_screen_size(void *mlx_ptr, int *sizex, int *sizey) +{ + XWindowAttributes xwAttr; + Status ret; + t_xvar *xvar; + + xvar = mlx_ptr; + ret = XGetWindowAttributes(xvar->display, xvar->root, &xwAttr); + (*sizex) = xwAttr.width; + (*sizey) = xwAttr.height; +} |