/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* main.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/10/04 17:55:21 by maldavid #+# #+# */ /* Updated: 2022/12/18 03:51:19 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ #include #include "../includes/mlx.h" int update(void *mlx) { static int i = 0; puts("dude"); i++; if (i > 1000000) mlx_loop_end(mlx); return (0); } int main(void) { void *win_ptr; void *mlx_ptr; mlx_ptr = mlx_init(); win_ptr = mlx_new_window(mlx_ptr, 400, 400, "My window"); mlx_loop_hook(mlx_ptr, update, mlx_ptr); mlx_loop(mlx_ptr); mlx_destroy_window(mlx_ptr, win_ptr); mlx_destroy_display(mlx_ptr); return (0); }