-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfdf.h
63 lines (58 loc) · 2.11 KB
/
fdf.h
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
/* ************************************************************************** */
/* */
/* :::::::: */
/* fdf.h :+: :+: */
/* +:+ */
/* By: jvan-hal <[email protected]> +#+ */
/* +#+ */
/* Created: 2023/01/30 10:25:31 by jvan-hal #+# #+# */
/* Updated: 2023/03/02 10:50:46 by jvan-hal ######## odam.nl */
/* */
/* ************************************************************************** */
#ifndef FDF_H
# define FDF_H
# include"./libft/libft.h"
# include"./MLX42/include/MLX42/MLX42.h"
typedef struct s_coord{
int x;
int y;
double z;
int sx;
int sy;
} t_coord;
typedef struct s_fdf{
mlx_t *mlx;
mlx_image_t *img[2];
mlx_texture_t *texture[2];
t_list *coords;
double trans_x;
double trans_y;
double rot_x;
double rot_y;
double rot_z;
double zoom;
int ox;
int oy;
} t_fdf;
void del(void *node);
int parse_input(int fd, t_list **coords);
int atoi_overflow(char *str, double *num);
int get_input(char *file, t_fdf *fdf);
void hooks(t_fdf *fdf);
void close_fdf(t_fdf *fdf);
void delete_prev_img(t_fdf *fdf);
void create_new_image(t_fdf *fdf);
void start_fdf(t_fdf *fdf);
void draw_legend(t_fdf *fdf);
void set_start_view(t_fdf *fdf);
void scale_map(t_fdf *fdf, int zoom);
void rot_map(t_fdf *fdf, int x, int y, int z);
void translate_map(t_fdf *fdf, int trans_x, int trans_y);
mlx_image_t *generate_image(t_fdf *fdf);
void draw_line_low(t_coord *start, t_coord *end, t_fdf *fdf);
void draw_line_high(t_coord *start, t_coord *end, t_fdf *fdf);
void keyhook(void *param);
void scrollhook(double xdelta, double ydelta, void *param);
int free_fdf(t_fdf *fdf);
void merror(t_fdf *fdf);
#endif