add init textures
This commit is contained in:
15
srcs/init/init_textures.c
Normal file
15
srcs/init/init_textures.c
Normal file
@@ -0,0 +1,15 @@
|
||||
#include "cube3d.h"
|
||||
|
||||
static void init_txtr_img(t_img *img, void *mlx_ptr, char *path)
|
||||
{
|
||||
img->ptr = mlx_xpm_file_to_image(mlx_ptr, path, &img->width, &img->height);
|
||||
img->data = mlx_get_data_addr(img->ptr, &img->bpp, &img->szl, &img->ndn);
|
||||
}
|
||||
|
||||
void init_txtr(t_txt *txt, void *mlx_ptr)
|
||||
{
|
||||
init_txtr_img(&txt->img_n, mlx_ptr, txt->txt_north);
|
||||
init_txtr_img(&txt->img_n, mlx_ptr, txt->txt_south);
|
||||
init_txtr_img(&txt->img_n, mlx_ptr, txt->txt_east);
|
||||
init_txtr_img(&txt->img_n, mlx_ptr, txt->txt_west);
|
||||
}
|
||||
Reference in New Issue
Block a user