-
Notifications
You must be signed in to change notification settings - Fork 0
/
fdf.h
124 lines (111 loc) · 2.6 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
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* fdf.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: nahmed-m <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2015/12/29 14:48:29 by nahmed-m #+# #+# */
/* Updated: 2016/01/13 18:01:47 by nahmed-m ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef FDF_H
# define FDF_H
# include "libft/includes/libft.h"
# include <mlx.h>
# include <fcntl.h>
# include <stdio.h>
# include <stdlib.h>
# include <unistd.h>
# define NAME "fdf"
# define X_WIN 1000
# define Y_WIN 1000
/*
** Map Of Keyboard
*/
# define ESC 53
# define TOP 126
# define BOT 125
# define LEFT 123
# define RIGHT 124
# define ZOOM 69
# define DEZOOM 78
# define ELEVATE 31
# define DOWN 37
/*
** Colors Defines
*/
# define BLUE 0x0000FF
# define YELLOW 0xFFFF00
# define GREEN 0x00FF00
# define TURQ 0x33CCFF
# define BROWN 0x993300
# define WHITE 0xFFFFFF
typedef struct s_env
{
int **cor;
int line;
int collum;
void *mlx;
void *win;
int basex;
int basey;
int size;
char *filename;
int color;
} t_env;
typedef struct s_trace
{
int i;
int k;
int x;
int y;
} t_trace;
typedef struct s_cor
{
int dx;
int sx;
int dy;
int sy;
int err;
int e2;
} t_cor;
typedef struct s_pos
{
int x;
int y;
} t_pos;
/*
** Window fuctions
*/
void window(t_env *win);
/*
** Draw fuctions
*/
int draw(t_env *map);
void line(t_pos *p1, t_pos *p2, t_env *map);
void ft_gen_x_axes_mid(t_env *e, int i, int s, t_trace *t);
void ft_gen_x_axes_top(t_env *e, int i, int s, t_trace *t);
void ft_gen_y_axes_mid(t_env *e, int i, int s, t_trace *t);
void ft_gen_y_axes_top(t_env *e, int i, int s, t_trace *t);
/*
** File fuctions
*/
void file(char *av, t_env *map);
/*
** Keyboard fuctions
*/
int keyboard(int keycode, t_env *map);
/*
** Utils fuctions
*/
void ft_exit(char *error);
void ft_print_2d_tab(int **tab, int line, int collum);
void ft_modify_tab(t_env *control, int ratio);
int color(int i);
void ft_black_screen(t_env *map);
/*
** Overlay fuctions
*/
void ft_set_overlay(t_env *e);
#endif