diff options
| author | Charles <sircharlesaze@gmail.com> | 2019-08-28 08:56:31 +0200 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2019-08-28 08:56:31 +0200 |
| commit | 0a808a0f355390c68a5ca6f93c10758107c67700 (patch) | |
| tree | ded488ba4737d0ca4d599b76046d0d726145032f /header.h | |
| parent | 003e9e628b3e7b516d3d70d78b6ba97bca69c813 (diff) | |
| download | mandelbrot-0a808a0f355390c68a5ca6f93c10758107c67700.tar.gz mandelbrot-0a808a0f355390c68a5ca6f93c10758107c67700.tar.bz2 mandelbrot-0a808a0f355390c68a5ca6f93c10758107c67700.zip | |
State stores the window size and the domain where to look the set
Diffstat (limited to 'header.h')
| -rw-r--r-- | header.h | 26 |
1 files changed, 11 insertions, 15 deletions
@@ -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); |
