Skip to content

Commit ea30a7d

Browse files
author
Anaelle LECLABART
committed
added controls menu
1 parent 0eaed0c commit ea30a7d

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

includes/fractol.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
/* By: anleclab <marvin@42.fr> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2019/02/15 15:25:34 by anleclab #+# #+# */
9-
/* Updated: 2019/02/27 09:19:11 by anleclab ### ########.fr */
9+
/* Updated: 2019/02/27 09:31:37 by anleclab ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

srcs/events_tools.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
/* By: anleclab <marvin@42.fr> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2019/02/27 09:00:02 by anleclab #+# #+# */
9-
/* Updated: 2019/02/27 09:24:45 by anleclab ### ########.fr */
9+
/* Updated: 2019/02/27 09:31:36 by anleclab ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

srcs/main.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
/* By: anleclab <marvin@42.fr> +#+ +:+ +#+ */
77
/* +#+#+#+#+#+ +#+ */
88
/* Created: 2019/02/15 15:28:53 by anleclab #+# #+# */
9-
/* Updated: 2019/02/27 09:21:29 by anleclab ### ########.fr */
9+
/* Updated: 2019/02/27 10:18:05 by anleclab ### ########.fr */
1010
/* */
1111
/* ************************************************************************** */
1212

@@ -58,6 +58,21 @@ static void fract_init(t_fract *fract)
5858
fract->y_offset = 0;
5959
}
6060

61+
static void print_controls(void)
62+
{
63+
ft_putstr("\n//////////////////////// CONTROLS ////////////////////////\n");
64+
ft_putstr("\n \033[0;33mchange mode\033[0m: C\n");
65+
ft_putstr(" \033[0;33mzoom\033[0m: scroll up/down (in zoom mode)\n");
66+
ft_putstr(" \033[0;33mcolor\033[0m: SPACE / scroll up/down (in color ");
67+
ft_putstr("mode)\n");
68+
ft_putstr(" \033[0;33mmove fractal\033[0m: up/down/left/right arrows\n");
69+
ft_putstr(" \033[0;33mchange julia parameters\033[0m: W/A/S/D / move ");
70+
ft_putstr("mouse (if active)\n");
71+
ft_putstr(" \033[0;33mactivate/deactivate mouse\033[0m: M\n");
72+
ft_putstr(" \033[0;33mexit\033[0m: ESC / red cross\n\n");
73+
ft_putstr("//////////////////////////////////////////////////////////\n\n");
74+
}
75+
6176
int main(int ac, char **av)
6277
{
6378
t_fract fract;
@@ -77,6 +92,7 @@ int main(int ac, char **av)
7792
error("filed to create image", &fract);
7893
if (!draw_fractal(&fract))
7994
error("failed to draw fractal", &fract);
95+
print_controls();
8096
mlx_hook(fract.win_ptr, 4, 0, &mouse_event, &fract);
8197
mlx_hook(fract.win_ptr, 17, 0, &close_win, &fract);
8298
mlx_hook(fract.win_ptr, 3, 0, &key_release, &fract);

0 commit comments

Comments
 (0)