improve gexit with init function and add basic mlx image gestion
This commit is contained in:
@@ -14,10 +14,15 @@ t_game *init_game(void)
|
||||
// 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)
|
||||
game->win_ptr = mlx_new_window(game->mlx_ptr, game->win_size_x,
|
||||
game->win_size_y, "test");
|
||||
// k(ey)_hook is the array containing the values of key press events
|
||||
ft_bzero(&game->k_hook, sizeof(game->k_hook));
|
||||
|
||||
// create image and get its data address
|
||||
game->img_ptr = mlx_new_image(game->mlx_ptr, game->win_size_x,
|
||||
game->win_size_y);
|
||||
game->img_data = mlx_get_data_addr(game->img_ptr, &(game->bpp),
|
||||
&(game->sizel), &(game->endian));
|
||||
return (game);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user