improve gexit with init function and add basic mlx image gestion

This commit is contained in:
Hugo LAMY
2022-03-25 18:49:06 +01:00
parent 3a1036ccdc
commit 02b5d88ea5
45 changed files with 139 additions and 7042 deletions

View File

@@ -1,13 +1,5 @@
#include "cube3d.h"
int shut_down(t_game *game)
{
mlx_destroy_window(game->mlx_ptr, game->win_ptr);
gexit(B_RED"close windows"RESET"\n");
exit(0);
return (0);
}
// temp, to test keypress hook
void keypress_do_action(t_game *game)
{
@@ -21,7 +13,7 @@ void keypress_do_action(t_game *game)
(game->plr_y) -= 5;
if (is_go_backward(game->k_hook))
(game->plr_y) += 5;
mlx_pixel_put(game->mlx_ptr, game->win_ptr, game->plr_x, game->plr_y, 0x74db74);
draw(game);
}