42_solong/draw.c

28 lines
1.2 KiB
C
Raw Normal View History

2022-12-22 11:41:31 -05:00
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* draw.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchauvet <cchauvet@student.42angouleme.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/12/13 15:49:23 by cchauvet #+# #+# */
2023-01-04 14:07:13 -05:00
/* Updated: 2023/01/04 19:05:04 by cchauvet ### ########.fr */
2022-12-22 11:41:31 -05:00
/* */
/* ************************************************************************** */
#include "solong.h"
2023-01-04 14:07:13 -05:00
void ft_draw_xpm(void *mlx, void *window, char *file, size_t *cord)
2022-12-22 11:41:31 -05:00
{
2023-01-04 14:07:13 -05:00
char *img_path;
2022-12-22 11:41:31 -05:00
void *img;
int bozo;
2023-01-04 14:07:13 -05:00
img_path = ft_strmerger(2, XPM_PATH, file);
if (img_path == NULL)
return ;
img = mlx_xpm_file_to_image(mlx, img_path, &bozo, &bozo);
mlx_put_image_to_window(mlx, window, img, cord[0], cord[1]);
mlx_destroy_image(mlx, img);
2022-12-22 11:41:31 -05:00
}