memorybook functionnal, with add

This commit is contained in:
Hugo LAMY
2022-03-25 21:27:24 +01:00
parent 02b5d88ea5
commit f645da7885
9 changed files with 113 additions and 110 deletions

View File

@@ -8,12 +8,11 @@ void destroy_mlx(void *param)
mlx_destroy_image(game->mlx_ptr, game->img_ptr);
mlx_destroy_window(game->mlx_ptr, game->win_ptr);
mlx_destroy_display(game->mlx_ptr);
free(game->mlx_ptr);
}
int shut_down()
{
gexit(B_RED"close windows"RESET"\n");
mb_exit(B_RED"close windows"RESET"\n");
return (0);
}
@@ -23,7 +22,7 @@ int main(int ac, char **av)
game = init_game();
init_parsing(ac, av, game);
gexit_init(destroy_mlx, game);
mb_init(destroy_mlx, game);
// receive a keypress event
mlx_hook(game->win_ptr, 2, 1L << 0, keypress, game);
@@ -35,4 +34,3 @@ int main(int ac, char **av)
mlx_loop(game->mlx_ptr);
return (0);
}