aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_draw_skybox.c
diff options
context:
space:
mode:
authorsalaaad2 <arthudurant263@gmail.com>2020-03-10 16:16:08 +0100
committersalaaad2 <arthudurant263@gmail.com>2020-03-10 16:16:08 +0100
commit0d589d0038624e3123e6166f6521d1421dd69b23 (patch)
tree26db0ad344a9c730192eea0bff01bb410ba225b7 /src/ft_draw_skybox.c
parentstill retard (diff)
parentok now (diff)
download42-cub3d-0d589d0038624e3123e6166f6521d1421dd69b23.tar.gz
42-cub3d-0d589d0038624e3123e6166f6521d1421dd69b23.tar.bz2
42-cub3d-0d589d0038624e3123e6166f6521d1421dd69b23.tar.xz
42-cub3d-0d589d0038624e3123e6166f6521d1421dd69b23.tar.zst
42-cub3d-0d589d0038624e3123e6166f6521d1421dd69b23.zip
merge master
Diffstat (limited to 'src/ft_draw_skybox.c')
-rw-r--r--src/ft_draw_skybox.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/ft_draw_skybox.c b/src/ft_draw_skybox.c
new file mode 100644
index 0000000..a446485
--- /dev/null
+++ b/src/ft_draw_skybox.c
@@ -0,0 +1,38 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* ft_draw_skybox.c :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: rbousset <marvin@42.fr> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2020/02/14 17:22:57 by rbousset #+# #+# */
+/* Updated: 2020/02/14 17:23:42 by rbousset ### ########lyon.fr */
+/* */
+/* ************************************************************************** */
+
+#include <cub3d.h>
+#include <mlx.h>
+
+void
+ ft_draw_skybox(t_cub *cl)
+{
+ int offset;
+
+ offset = 640;
+ if (cl->plist.dir_x > 0)
+ offset = -offset;
+ mlx_put_image_to_window(cl->wlist.wlx, cl->wlist.winptr,
+ cl->tlist[7].img, offset * cl->plist.dir_y, -125);
+ mlx_put_image_to_window(cl->wlist.wlx, cl->wlist.winptr,
+ cl->tlist[7].img, offset * cl->plist.dir_y, -125);
+ mlx_put_image_to_window(cl->wlist.wlx, cl->wlist.winptr,
+ cl->tlist[7].img, offset * cl->plist.dir_y, -125);
+ mlx_put_image_to_window(cl->wlist.wlx, cl->wlist.winptr,
+ cl->tlist[7].img, offset * cl->plist.dir_y, -125);
+ mlx_put_image_to_window(cl->wlist.wlx, cl->wlist.winptr,
+ cl->tlist[7].img, offset * cl->plist.dir_y, -125);
+ mlx_put_image_to_window(cl->wlist.wlx, cl->wlist.winptr,
+ cl->tlist[7].img, offset * cl->plist.dir_y, -125);
+ mlx_put_image_to_window(cl->wlist.wlx, cl->wlist.winptr,
+ cl->tlist[7].img, offset * cl->plist.dir_y, -125);
+}