aboutsummaryrefslogtreecommitdiff
path: root/header.h
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2019-08-28 08:56:31 +0200
committerCharles <sircharlesaze@gmail.com>2019-08-28 08:56:31 +0200
commit0a808a0f355390c68a5ca6f93c10758107c67700 (patch)
treeded488ba4737d0ca4d599b76046d0d726145032f /header.h
parent003e9e628b3e7b516d3d70d78b6ba97bca69c813 (diff)
downloadmandelbrot_cpu-0a808a0f355390c68a5ca6f93c10758107c67700.tar.gz
mandelbrot_cpu-0a808a0f355390c68a5ca6f93c10758107c67700.tar.bz2
mandelbrot_cpu-0a808a0f355390c68a5ca6f93c10758107c67700.zip
State stores the window size and the domain where to look the set
Diffstat (limited to 'header.h')
-rw-r--r--header.h26
1 files changed, 11 insertions, 15 deletions
diff --git a/header.h b/header.h
index 8873077..3f86f46 100644
--- a/header.h
+++ b/header.h
@@ -5,37 +5,33 @@
# include <complex.h>
# include <SDL2/SDL.h>
-# define WINDOW_W 500
-# define WINDOW_H 500
-
-# define LO -1.5
-# define HI 1.5
-# define AXIS_DIV 46.0
-# define AXIS_STEP ((HI - LO) / AXIS_DIV)
+# define REAL_LO -2.0
+# define REAL_HI 2.0
+# define IMAG_LO -2.0
+# define IMAG_HI 2.0
# define MAX_ITERATION 30
# define _INFINITY 4
-
typedef struct
{
SDL_Window *window;
SDL_Renderer *renderer;
bool running;
+ int window_w;
+ int window_h;
+ double real_lo;
+ double real_hi;
+ double imag_lo;
+ double imag_hi;
} GState;
-typedef struct
-{
- int window_width;
- int window_height;
-} GConf;
-
// mandelbrot.c
int mandelbrot_in_set(double _Complex c);
void mandelbrot_print(void);
// graphics.c
-GState *graphics_init(GConf *conf);
+GState *graphics_init(void);
void graphics_quit(GState *state);
void graphics_run(GState *state);