aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_draw_scene.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-03-13 00:25:57 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2020-03-13 00:25:57 +0100
commit24c048797025d31a23413c69a2e9ed5009e79eaf (patch)
tree6edfa5f053ba16e62cd65c671bb7e84fd9ab04f9 /src/ft_draw_scene.c
parentOk nice (diff)
download42-cub3d-24c048797025d31a23413c69a2e9ed5009e79eaf.tar.gz
42-cub3d-24c048797025d31a23413c69a2e9ed5009e79eaf.tar.bz2
42-cub3d-24c048797025d31a23413c69a2e9ed5009e79eaf.tar.xz
42-cub3d-24c048797025d31a23413c69a2e9ed5009e79eaf.tar.zst
42-cub3d-24c048797025d31a23413c69a2e9ed5009e79eaf.zip
Better linux compat
Diffstat (limited to 'src/ft_draw_scene.c')
-rw-r--r--src/ft_draw_scene.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/ft_draw_scene.c b/src/ft_draw_scene.c
index 80cd1bc..1edef2a 100644
--- a/src/ft_draw_scene.c
+++ b/src/ft_draw_scene.c
@@ -41,6 +41,13 @@ static int8_t
void
ft_draw_scene(t_cub *clist)
{
+ if (FT_OS == 2)
+ {
+ clist->img.img = mlx_new_image(clist->wlist.wlx,
+ clist->wlist.x_size, clist->wlist.y_size);
+ clist->img.ptr = mlx_get_data_addr(clist->img.img, &clist->img.bpp,
+ &clist->img.sizeline, &clist->img.endian);
+ }
if (clist->doicast)
ft_castray(clist);
else
@@ -51,6 +58,8 @@ void
ft_draw_skybox(clist);
mlx_put_image_to_window(clist->wlist.wlx,
clist->wlist.winptr, clist->img.img, 0, 0);
+ if (FT_OS == 2)
+ mlx_destroy_image(clist->wlist.wlx, clist->img.img);
if (clist->ishud && clist->mlist.isnlvl)
if (ft_put_stage(clist) < 0)
ft_error(FT_RET_ALLOC_ERR, FT_ERR_ALLOCATE, clist);