cub3d/cub3d.h
2023-10-26 23:48:16 +02:00

68 lines
2.0 KiB
C

/* ************************************************************************** */
/* */
/* :::::::: */
/* cub3d.h :+: :+: */
/* +:+ */
/* By: houtworm <codam@houtworm.net> +#+ */
/* +#+ */
/* Created: 2023/10/26 10:46:35 by houtworm #+# #+# */
/* Updated: 2023/10/26 21:52:52 by houtworm ######## odam.nl */
/* */
/* ************************************************************************** */
#ifndef CUB3D_H
# define CUB3D_H
# include <unistd.h>
# include <math.h>
# include <fcntl.h>
# include "libft/libft.h"
# include "getnextline/get_next_line.h"
# include "mlx/include/MLX42/MLX42.h"
typedef struct s_varlist
{
mlx_t *mlx;
mlx_image_t *img;
int w;
int h;
char **map;
double posx;
double posy;
double dirx;
double diry;
double planex;
double planey;
double camerax;
double cameray;
double raydirx;
double raydiry;
int mapx;
int mapy;
double sidedistx;
double sidedisty;
double deltadistx;
double deltadisty;
double perpwalldist;
int stepx;
int stepy;
int hit;
int side;
} t_varlist;
// init.c
t_varlist initvarlist(void);
// parse.c
char **ft_getmap(void);
t_varlist ft_parseconfigfile(t_varlist vl, char *filename);
// keys.c
void ft_movementkeys(t_varlist *vl);
void keyhook(mlx_key_data_t kd, void *param);
void scrollhook(double xdelta, double ydelta, void *param);
void resizehook(int x, int y, void *param);
// draw.c
void ft_drawnextframe(t_varlist *vl);
// error.c
int ft_errorexit(char *reason, char *function, int code);
#endif