aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_draw_scene.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-03-17 17:15:32 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2020-03-17 17:15:32 +0100
commit05ad2085ab6ce4ffb280b21ce3f321b2bd75aa9e (patch)
treec6c521c8f2ad8df4477005b8225427b7459daf32 /src/ft_draw_scene.c
parentMerge branch 'back-to-pthread' (diff)
download42-cub3d-05ad2085ab6ce4ffb280b21ce3f321b2bd75aa9e.tar.gz
42-cub3d-05ad2085ab6ce4ffb280b21ce3f321b2bd75aa9e.tar.bz2
42-cub3d-05ad2085ab6ce4ffb280b21ce3f321b2bd75aa9e.tar.xz
42-cub3d-05ad2085ab6ce4ffb280b21ce3f321b2bd75aa9e.tar.zst
42-cub3d-05ad2085ab6ce4ffb280b21ce3f321b2bd75aa9e.zip
fps counter is bav
Diffstat (limited to 'src/ft_draw_scene.c')
-rw-r--r--src/ft_draw_scene.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/ft_draw_scene.c b/src/ft_draw_scene.c
index c7b07a1..86009f6 100644
--- a/src/ft_draw_scene.c
+++ b/src/ft_draw_scene.c
@@ -16,6 +16,16 @@
#include <stdlib.h>
#include <stdint.h>
+static void
+ ft_put_fps(t_cub *clist)
+{
+ mlx_string_put(clist->wlist.wlx,
+ clist->wlist.winptr,
+ 10, 20,
+ 0x00eeeeee,
+ clist->fps_count);
+}
+
static int8_t
ft_put_stage(t_cub *clist)
{
@@ -61,9 +71,12 @@ void
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)
+ if (clist->ishud)
+ {
+ ft_put_fps(clist);
+ if (clist->mlist.isnlvl && ft_put_stage(clist) < 0)
ft_error(FT_RET_ALLOC_ERR, FT_ERR_ALLOCATE, clist);
+ }
}
void