2023-04-26 08:58:24 -04:00
|
|
|
/* ************************************************************************** */
|
|
|
|
/* */
|
|
|
|
/* ::: :::::::: */
|
|
|
|
/* game.c :+: :+: :+: */
|
|
|
|
/* +:+ +:+ +:+ */
|
|
|
|
/* By: erey-bet <marvin@42.fr> +#+ +:+ +#+ */
|
|
|
|
/* +#+#+#+#+#+ +#+ */
|
|
|
|
/* Created: 2023/04/26 12:59:53 by erey-bet #+# #+# */
|
2023-04-26 09:45:21 -04:00
|
|
|
/* Updated: 2023/04/26 15:44:55 by erey-bet ### ########.fr */
|
2023-04-26 08:58:24 -04:00
|
|
|
/* */
|
|
|
|
/* ************************************************************************** */
|
|
|
|
|
|
|
|
#include "../cube3D.h"
|
|
|
|
|
|
|
|
int start_game(t_map *map)
|
|
|
|
{
|
2023-04-26 09:45:21 -04:00
|
|
|
t_game *game;
|
2023-04-26 08:58:24 -04:00
|
|
|
|
|
|
|
(void)map;
|
2023-04-26 09:45:21 -04:00
|
|
|
game->mlx = mlx_init(1920, 1080, "jan lili", true)
|
|
|
|
if (mlx)
|
|
|
|
return (1);
|
|
|
|
game->window = mlx_new_image(game->mlx, 128, 128);
|
|
|
|
if (game->image)
|
|
|
|
{
|
|
|
|
mlx_close_window(game->mlx);
|
|
|
|
return(1);
|
|
|
|
}
|
|
|
|
if (mlx_image_to_window(game->mlx, game->window, 0, 0) == -1)
|
|
|
|
{
|
|
|
|
mlx_close_window(game->mlx);
|
|
|
|
return(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
mlx_loop_hook(game->mlx, manage, game)
|
|
|
|
mlx_loop(game->mlx);
|
|
|
|
mlx_terminate(game->mlx);
|
2023-04-26 08:58:24 -04:00
|
|
|
|
|
|
|
return (0);
|
|
|
|
}
|