39 lines
1.4 KiB
C
39 lines
1.4 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* main.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: qmennen <qmennen@student.codam.nl> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2025/04/15 16:01:29 by qmennen #+# #+# */
|
|
/* Updated: 2025/04/15 19:19:00 by qmennen ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
# include "cub3d.h"
|
|
|
|
static int init_game(t_game **game)
|
|
{
|
|
if (! game_create(game))
|
|
return (FAILURE);
|
|
if (!player_create(game))
|
|
return (FAILURE);
|
|
screen_center((*game)->screen);
|
|
mlx_key_hook((*game)->screen->mlx, keyhandle, *game);
|
|
mlx_loop_hook((*game)->screen->mlx, game_loop, *game);
|
|
return (SUCCESS);
|
|
}
|
|
|
|
int main(void)
|
|
{
|
|
t_game *game;
|
|
|
|
errno = 0;
|
|
game = NULL;
|
|
init_game(&game);
|
|
perror("after init");
|
|
mlx_loop(game->screen->mlx);
|
|
game_terminate(game);
|
|
return (EXIT_SUCCESS);
|
|
}
|