-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpreprocss.h
More file actions
183 lines (161 loc) · 3.53 KB
/
preprocss.h
File metadata and controls
183 lines (161 loc) · 3.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* preprocss.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: TheTerror <jfaye@student.42lyon.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/08/17 16:41:14 by TheTerror #+# #+# */
/* Updated: 2024/02/11 15:15:23 by TheTerror ### ########lyon.fr */
/* */
/* ************************************************************************** */
#ifndef PREPROCSS_H
# define PREPROCSS_H
# include "./libft/libft.h"
# define _SIZE_X_HONOR 1920 //screen's widht of the PC HONOR MAGICBOOK
# define _SIZE_Y_HONOR 1080 //screen's height of the PC HONOR MAGICBOOK
# define _SIZE_X_MAC 2840 //screen's widht of 42's MAC
# define _SIZE_Y_MAC 2160 //screen's height of 42's MAC
# define _SIZE_X _SIZE_X_HONOR //window's x size
# define _SIZE_Y _SIZE_Y_HONOR //window's y size
# define _WIDHT _SIZE_X //image's widht
# define _HEIGHT _SIZE_Y //image's height
# define __NTR -100 //Nothing To Report
# define __ON_DESTROY 17 //Button x window killer
# define __ON_KEYUP 03
# define __ON_MOUSEDOWN 04
# define __KEYRELEASEMASK 2L
# define __BUTTONPRESSMASK 4L
# define __SPHERE 0
# define __CYLINDER 1
# define __PLANE 2
# define __NOTHING -1
/*KEYCODES*/
# define __ESC 65307 //ESCape key
# define __H_ 104 //h key
# define __L_ 108 //l key
# define __ZOOMIN 4 //mouse wheel
# define __ZOOMOUT 5 //mouse wheel
# define __LEFT 65361 //left key
# define __RIGHT 65363 //right key
# define __UP 65362 //up key
# define __DOWN 65364 //down key
# define __LEFTBUTTON 1 //mouse's left button
# define __RIGHTBUTTON 3 //mouse's right button
# define __WHEELBUTTON 2 //mouse's wheel button
typedef struct s_rgb
{
int r;
int g;
int b;
} t_rgb;
typedef struct s_coordinates
{
double x;
double y;
double z;
} t_coord;
typedef struct s_vector
{
double x;
double y;
double z;
t_coord o;
t_coord e;
} t_vec;
typedef struct s_img
{
char *addr;
int bpp;
int size_line;
int endian;
void *img;
} t_img;
typedef struct s_ambient
{
double ratio;
t_rgb rgb;
} t_amb;
typedef struct s_camera
{
t_coord pov;
t_vec dir;
double fov;
} t_cam;
typedef struct s_light
{
t_coord pol;
double ratio;
t_rgb rgb;
} t_light;
typedef struct s_sphere
{
t_coord o;
double d;
t_rgb rgb;
} t_sp;
typedef struct s_plane
{
t_coord p;
t_vec normal;
t_rgb rgb;
} t_pl;
typedef struct s_cylindre
{
t_coord o;
t_vec axis;
double d;
double r;
double h;
t_rgb rgb;
} t_cy;
typedef struct obj
{
int type;
int index;
} t_obj;
typedef struct s_ray
{
t_coord o;
t_vec dir;
t_obj obj;
int color;
double len;
} t_ray;
typedef struct s_variables
{
void *xptr;
void *win;
t_img *im;
char *file;
t_amb *amb;
t_cam *cam;
t_light *light;
t_sp **sp;
t_pl **pl;
t_cy **cy;
t_ray *ray;
} t_vars;
typedef struct s_parameters
{
double k;
double f;
double g;
double h;
double alpha;
double beta;
double lamda;
double e;
double l;
double m;
double n;
double a;
double b;
double c;
double delta;
double t1;
double t2;
double hp1;
double hp2;
} t_params;
#endif