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

View File

@@ -0,0 +1,41 @@
#include "cube3d.h"
int is_esc(int *k_hook)
{
if (!ft_arrintchr(k_hook, KEY_ESC, 3))
return 1;
return 0;
}
int is_go_left(int *k_hook)
{
if (!ft_arrintchr(k_hook, KEY_A, 3))
return 1;
if (!ft_arrintchr(k_hook, KEY_Q, 3))
return 1;
return 0;
}
int is_go_right(int *k_hook)
{
if (!ft_arrintchr(k_hook, KEY_D, 3))
return 1;
return 0;
}
int is_go_forward(int *k_hook)
{
if (!ft_arrintchr(k_hook, KEY_W, 3))
return 1;
if (!ft_arrintchr(k_hook, KEY_Z, 3))
return 1;
return 0;
}
int is_go_backward(int *k_hook)
{
if (!ft_arrintchr(k_hook, KEY_S, 3))
return 1;
return 0;
}