start project with header, struct, mlx functionnal, and basic key event action

This commit is contained in:
hugogogo
2022-03-23 14:27:36 +01:00
parent 1959a1a9a3
commit 95bd304708
11 changed files with 228 additions and 1 deletions

18
srcs/cube3d.c Normal file
View File

@@ -0,0 +1,18 @@
#include "cube3d.h"
int main(int ac, char **av)
{
t_game *game;
game = init_game();
init_parsing(ac, av, game);
// receive a keypress event
mlx_hook(game->win_ptr, 2, 1L << 0, keypress, game);
// receive event when clicking the red button to close the window
mlx_hook(game->win_ptr, 17, 1L << 17, shut_down, game);
// infinite loop that waits for events to occurs
mlx_loop(game->mlx_ptr);
return (0);
}