aboutsummaryrefslogtreecommitdiff
path: root/include/fractol.h
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-02-24 15:39:22 +0100
committerCharles <sircharlesaze@gmail.com>2020-02-24 15:39:22 +0100
commitc6f87a62b31325e91bc8c847de9b20647a9b1cd8 (patch)
treeaacf869e3c22f8937637c3e7aa15794b2b4680f0 /include/fractol.h
parentc924493670af7285683295d7ab38991e018b65cf (diff)
downloadfractol-c6f87a62b31325e91bc8c847de9b20647a9b1cd8.tar.gz
fractol-c6f87a62b31325e91bc8c847de9b20647a9b1cd8.tar.bz2
fractol-c6f87a62b31325e91bc8c847de9b20647a9b1cd8.zip
Added julia fractal and mouse modify julia constant
Diffstat (limited to 'include/fractol.h')
-rw-r--r--include/fractol.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/include/fractol.h b/include/fractol.h
index c41231b..e315e6b 100644
--- a/include/fractol.h
+++ b/include/fractol.h
@@ -6,7 +6,7 @@
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/02/24 09:28:16 by cacharle #+# #+# */
-/* Updated: 2020/02/24 13:59:01 by cacharle ### ########.fr */
+/* Updated: 2020/02/24 15:29:50 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
@@ -71,19 +71,22 @@ typedef struct
double i;
} t_complex;
-typedef int (*t_func_fractal)(t_complex z);
+struct s_state;
-typedef struct
+typedef int (*t_func_fractal)(struct s_state *state, t_complex z);
+
+typedef struct s_state
{
bool running;
+ bool updated;
void *mlx_ptr;
void *window_ptr;
t_image window;
- t_complex window_complex[WINDOW_HEIGHT * WINDOW_WIDTH];
t_color palette[PALETTE_SIZE];
t_func_fractal func;
t_complex center;
t_complex plane;
+ t_complex julia_const;
} t_state;
/*
@@ -98,7 +101,6 @@ int state_destroy(t_state *state);
*/
int render_update(t_state *state);
-void render_update_window_complex(t_state *state);
/*
** event.c
@@ -107,12 +109,14 @@ void render_update_window_complex(t_state *state);
int event_quit(t_state *state);
int event_keydown(int key, t_state *state);
int event_mouse(int button, int x, int y, t_state *state);
+int event_mouse_motion(int x, int y, t_state *state);
/*
** fractals/
*/
-int mandelbrot(t_complex z);
+int mandelbrot(t_state *state, t_complex z);
+int julia(t_state *state, t_complex z);
/*
** helper.c