From 05ad2085ab6ce4ffb280b21ce3f321b2bd75aa9e Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Tue, 17 Mar 2020 17:15:32 +0100 Subject: fps counter is bav --- src/ft_draw_scene.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'src/ft_draw_scene.c') 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 #include +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 -- cgit v1.2.3