fixing some bad memory usage

This commit is contained in:
Kbz-8
2024-03-25 13:57:20 +01:00
parent 57c5ae5415
commit be52578d37
35 changed files with 1294 additions and 1298 deletions

View File

@@ -6,7 +6,7 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/04 17:55:21 by maldavid #+# #+# */
/* Updated: 2024/02/24 01:07:56 by maldavid ### ########.fr */
/* Updated: 2024/03/14 20:01:01 by maldavid ### ########.fr */
/* */
/* ************************************************************************** */
@@ -23,6 +23,8 @@ typedef struct
void* img;
} mlx_t;
void* img = NULL;
int update(void* param)
{
static int i = 0;
@@ -30,7 +32,13 @@ int update(void* param)
if(i == 200)
mlx_clear_window(mlx->mlx, mlx->win);
if(img)
mlx_destroy_image(mlx->mlx,img);
img = mlx_new_image(mlx->mlx, 800, 800);
mlx_set_image_pixel(mlx->mlx, img, 4, 4, 0xFF00FF00);
mlx_put_image_to_window(mlx->mlx, mlx->win, img, 0, 0);
if(i >= 250)
mlx_set_font_scale(mlx->mlx, mlx->win, "default", 16.f);
else