39 lines
1.4 KiB
C
39 lines
1.4 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* input.h :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: mcolonna <marvin@42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2024/10/17 14:43:09 by mcolonna #+# #+# */
|
|
/* Updated: 2024/11/07 19:03:25 by mcolonna ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#ifndef INPUT_H
|
|
# define INPUT_H
|
|
|
|
# include "include.h"
|
|
|
|
/// @brief For g_input_actions
|
|
typedef struct s_input_actions
|
|
{
|
|
bool left;
|
|
bool right;
|
|
bool up;
|
|
bool down;
|
|
bool quit;
|
|
int rotate;
|
|
} t_input_actions;
|
|
|
|
/// @brief Modified by the input of the user. A value becomes true
|
|
/// when the user presses the corresponding key.
|
|
extern t_input_actions g_input_actions;
|
|
|
|
/// @brief To handle the input of a window.
|
|
///
|
|
/// @param mlx_ptr mlx connection identifier
|
|
/// @param win_ptr Reference to the window to use.
|
|
void input_init(void *mlx_ptr, void *win_ptr);
|
|
|
|
#endif
|