diff options
| author | Charles <sircharlesaze@gmail.com> | 2019-08-28 13:57:11 +0200 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2019-08-28 13:57:11 +0200 |
| commit | df6e7cbaa0edf2df8b5f3929a2eb34fa2aa5a28c (patch) | |
| tree | b27d14df93691892c8e906435b8c4ee9ac46b5bc /header.h | |
| parent | ff61da6fb9720106d7869a0e5026810450d8f515 (diff) | |
| download | mandelbrot-df6e7cbaa0edf2df8b5f3929a2eb34fa2aa5a28c.tar.gz mandelbrot-df6e7cbaa0edf2df8b5f3929a2eb34fa2aa5a28c.tar.bz2 mandelbrot-df6e7cbaa0edf2df8b5f3929a2eb34fa2aa5a28c.zip | |
Proportionnal movement and zoom
Zooming and moving is proportionnal to the range we are viewing,
feels more natural than incrementing by a constant value.
Diffstat (limited to 'header.h')
| -rw-r--r-- | header.h | 21 |
1 files changed, 13 insertions, 8 deletions
@@ -5,10 +5,10 @@ # include <complex.h> # include <SDL2/SDL.h> -# define REAL_LO -2.0 -# define REAL_HI 2.0 -# define IMAG_LO -2.0 -# define IMAG_HI 2.0 +# define CENTER_X 0.0 +# define CENTER_Y 0.0 +# define REAL_RANGE 4.0 +# define IMAG_RANGE 4.0 # define MAX_ITERATION 35 # define ESCAPE_VALUE 2 @@ -19,15 +19,20 @@ typedef int Color; typedef struct { + double x; + double y; +} Point; + +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; + Point center; + double real_range; + double imag_range; Color *palette; } GState; |
