42_cube3D/game/game.h
Etienne Rey-bethbeder da452769c2 _
2023-05-02 15:39:16 +02:00

60 lines
1.5 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* game.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: erey-bet <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/04/26 15:29:34 by erey-bet #+# #+# */
/* Updated: 2023/05/02 15:32:43 by erey-bet ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef GAME_H
# define GAME_H
# include "../cube3D.h"
# include <math.h>
# define WIDTH 1920
# define HEIGHT 1080
typedef struct s_player
{
double pos_x;
double pos_y;
double dir_x;
double dir_y;
double pla_x;
double pla_y;
} t_ply;
typedef struct s_raycast
{
double x;
double y;
} t_ray;
typedef struct s_game
{
mlx_t *mlx;
mlx_image_t *window;
t_ply *ply;
t_map *map;
t_ray *ray;
} t_game;
/* INIT */
t_game *init(t_map *map);
/* MANAGE */
void manage(mlx_key_data_t keydata, void *param);
/* KEYS */
int manage_keys(mlx_key_data_t keydata, t_game *game);
/* RAYCASTING */
int raycasting(t_game *game);
#endif