aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_drawsquare.c
diff options
context:
space:
mode:
authorRudy Bousset <rbousset@z2r4p3.le-101.fr>2020-01-23 18:46:55 +0100
committerRudy Bousset <rbousset@z2r4p3.le-101.fr>2020-01-23 18:46:55 +0100
commitdada4b12f07388262729a1b979e53e28bfb79db3 (patch)
tree4231057b3a7fc3fc2f4e100f9e188949df146023 /src/ft_drawsquare.c
parentPretty fine (diff)
download42-cub3d-dada4b12f07388262729a1b979e53e28bfb79db3.tar.gz
42-cub3d-dada4b12f07388262729a1b979e53e28bfb79db3.tar.bz2
42-cub3d-dada4b12f07388262729a1b979e53e28bfb79db3.tar.xz
42-cub3d-dada4b12f07388262729a1b979e53e28bfb79db3.tar.zst
42-cub3d-dada4b12f07388262729a1b979e53e28bfb79db3.zip
Nice squares
Diffstat (limited to '')
-rw-r--r--src/ft_drawsquare.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/ft_drawsquare.c b/src/ft_drawsquare.c
new file mode 100644
index 0000000..d720f44
--- /dev/null
+++ b/src/ft_drawsquare.c
@@ -0,0 +1,22 @@
+#include <mlx.h>
+#include <cub3d.h>
+
+void
+ft_drawsquare(t_win *wlist, int a, int b)
+{
+ int x;
+ int y;
+
+ x = a;
+ y = b;
+ while (x > a - 40)
+ {
+ while (y > b - 40)
+ {
+ mlx_pixel_put(wlist->wlx, wlist->winptr, x, y, 255);
+ y--;
+ }
+ y = b;
+ x--;
+ }
+}