Files
42_INT_10_cube3d/srcs/init/init_struct.c
2022-03-24 21:53:03 +01:00

24 lines
550 B
C

#include "cube3d.h"
t_game *init_game(void)
{
t_game *game;
game = gmalloc(sizeof(t_game));
// player first position
game->plr_x = 16;
game->plr_y = 16;
// size window
game->win_size_x = 500;
game->win_size_y = 500;
// init connexion to server
game->mlx_ptr = mlx_init();
// create the window
game->win_ptr = mlx_new_window(game->mlx_ptr, game->win_size_x, game->win_size_y, "test");
// fill k_hook with zeros (key_hook, the array containing the values of key press)
ft_bzero(&game->k_hook, sizeof(game->k_hook));
return (game);
}