aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/main.c b/src/main.c
index 944d5aa..9bda98b 100644
--- a/src/main.c
+++ b/src/main.c
@@ -6,7 +6,7 @@
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/02/24 09:27:44 by cacharle #+# #+# */
-/* Updated: 2020/02/24 13:55:02 by cacharle ### ########.fr */
+/* Updated: 2020/02/24 15:28:40 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
@@ -16,15 +16,14 @@ int main(int argc, char **argv)
{
t_state state;
- if (argc != 2)
+ if (argc != 2 || state_init(&state, argv[1]) < 0)
{
ft_putstr("mandelbrot\njulia\n");
return (0);
}
- if (state_init(&state, argv[1]) < 0)
- return (1);
mlx_hook(state.window_ptr, 17, 0, event_quit, (void*)&state);
mlx_hook(state.window_ptr, 2, 2, event_keydown, (void*)&state);
+ mlx_hook(state.window_ptr, 6, 64, event_mouse_motion, (void*)&state);
mlx_mouse_hook(state.window_ptr, event_mouse, (void*)&state);
mlx_loop_hook(state.mlx_ptr, render_update, (void*)&state);
mlx_loop(state.mlx_ptr);