feat: testing how to play with textures
This commit is contained in:
parent
badd6534f4
commit
e581c72b02
14 changed files with 598 additions and 313 deletions
68
test/test.h
68
test/test.h
|
|
@ -6,53 +6,55 @@
|
|||
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/11/27 12:07:20 by rparodi #+# #+# */
|
||||
/* Updated: 2024/11/28 11:56:24 by bgoulard ### ########.fr */
|
||||
/* Updated: 2024/11/27 12:08:19 by rparodi ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#ifndef TEST_H
|
||||
# define TEST_H
|
||||
|
||||
// define keys
|
||||
# define XK_LATIN_1
|
||||
# include <X11/keysym.h>
|
||||
# include "minilibx-linux/mlx.h"
|
||||
# include <math.h>
|
||||
# include <stdio.h>
|
||||
# include <stdlib.h>
|
||||
|
||||
# define WINDOW_WIDTH 1920
|
||||
# define WINDOW_HEIGHT 1080
|
||||
# define WINDOW_WIDTH 1024
|
||||
# define WINDOW_HEIGHT 768
|
||||
# define MAP_WIDTH 24
|
||||
# define MAP_HEIGHT 24
|
||||
# define MOVE_SPEED 0.5
|
||||
# define ROT_SPEED 0.1
|
||||
# define ROT_SPEED 0.5
|
||||
|
||||
# define FOV 70
|
||||
|
||||
typedef struct s_2dpoint
|
||||
{
|
||||
double x;
|
||||
double y;
|
||||
} t_2dpoint;
|
||||
|
||||
typedef struct s_2ipoint
|
||||
{
|
||||
int x;
|
||||
int y;
|
||||
} t_2ipoint;
|
||||
typedef struct s_texture {
|
||||
void *img;
|
||||
char *addr;
|
||||
int width;
|
||||
int height;
|
||||
int bits_per_pixel;
|
||||
int line_length;
|
||||
int endian;
|
||||
} t_texture;
|
||||
|
||||
typedef struct s_data
|
||||
{
|
||||
void *mlx;
|
||||
void *win;
|
||||
void *img;
|
||||
char *addr;
|
||||
int bits_per_pixel;
|
||||
int line_length;
|
||||
int endian;
|
||||
t_2ipoint screen_size;
|
||||
|
||||
t_2dpoint pos;
|
||||
t_2ipoint pos_i;
|
||||
t_2dpoint dir;
|
||||
t_2dpoint plane;
|
||||
void *mlx;
|
||||
void *win;
|
||||
void *img;
|
||||
char *addr;
|
||||
int bits_per_pixel;
|
||||
int line_length;
|
||||
int endian;
|
||||
double pos_x;
|
||||
double pos_y;
|
||||
double dir_x;
|
||||
double dir_y;
|
||||
double plane_x;
|
||||
double plane_y;
|
||||
t_texture wall_so;
|
||||
t_texture wall_no;
|
||||
t_texture wall_we;
|
||||
t_texture wall_ea;
|
||||
t_texture floor;
|
||||
} t_data;
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue