diff options
| author | Charles <sircharlesaze@gmail.com> | 2020-05-19 13:22:59 +0200 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2020-05-19 13:22:59 +0200 |
| commit | 6a80b1b70ec069b051c0e31aafac6eb596e20261 (patch) | |
| tree | edf9856bcd2b4415796a2a49f0232ba830e69560 /header.h | |
| parent | c5008a4e62fb83eb71f5f94f622c01f2d8fe8b6b (diff) | |
| download | mandelbrot-6a80b1b70ec069b051c0e31aafac6eb596e20261.tar.gz mandelbrot-6a80b1b70ec069b051c0e31aafac6eb596e20261.tar.bz2 mandelbrot-6a80b1b70ec069b051c0e31aafac6eb596e20261.zip | |
Back to basic SDL application boilerplate
Diffstat (limited to 'header.h')
| -rw-r--r-- | header.h | 88 |
1 files changed, 0 insertions, 88 deletions
diff --git a/header.h b/header.h deleted file mode 100644 index 92b4d83..0000000 --- a/header.h +++ /dev/null @@ -1,88 +0,0 @@ -#ifndef HEADER_H -# define HEADER_H - -# include <stdbool.h> -# include <SDL2/SDL.h> - -# define MAX_ITERATION 200 -# define ESCAPE_RADIUS 10 -# define ESCAPE_RADIUS_SQUARED (ESCAPE_RADIUS * ESCAPE_RADIUS) - -# define PIXELS_CHANELS 3 -# define PIXELS_DEPTH (PIXELS_CHANELS * 8) - -typedef uint8_t Byte; -typedef int ColorHexcode; - -typedef union -{ - ColorHexcode hexcode; - struct - { - Byte b; - Byte g; - Byte r; - } rgb; -} Color; - -typedef struct -{ - double x; - double y; -} Point; - -typedef struct -{ - SDL_Window *window; - SDL_Renderer *renderer; - bool running; - int window_w; - int window_h; - Point center; - double real_range; - double imag_range; - Color *palette; - Color in_set_color; - bool moving; - bool changed; - SDL_Texture *canvas; -} GState; - -typedef struct -{ - int window_w; - int window_h; - double real_range; - double imag_range; - double center_x; - double center_y; -} Config; - -typedef struct -{ - double real_lo; - double real_hi; - double imag_step; - int width; - double imag; - Color *palette; - uint8_t *row; -} ThreadArgs; - -// mandelbrot.c -int mandelbrot_in_set(double a, double b); -void mandelbrot_print(void); -void *mandelbrot_pixels(double real_lo, double real_hi, double imag_lo, - double imag_hi, int width, int height, Color *palette); - -// graphics.c -GState *graphics_init(Config *config); -void graphics_quit(GState *state); -void graphics_run(GState *state); - -// helper.c -double map_range(double x, double src_lo, double src_hi, double dest_lo, double dest_hi); -Color helper_HSL_to_RGB(int hue, double saturation, double lightness); -double double_rand(void); - -#endif |
