DEVELOPMENT ENVIRONMENT

~alex/mandelbrot-set-gen

ref: 5ce56c337bfc58b08382aef46ab299c1546fec16 mandelbrot-set-gen/include/mandelbrot.h -rw-r--r-- 853 bytes
5ce56c33Alejandro Laguna refactor: separate SDL init to a diff function a month ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef MANDELBROT_H
#define MANDELBROT_H

#include "SDL3/SDL.h"

// TODO: GPU shadering option
// TODO: flexible window size
// TODO: maybe? change colors

#define WINDOW_TITLE "Mandelbrot Visualization"
#define WINDOW_WIDTH 800
#define WINDOW_HEIGHT 600

typedef struct position_s {
    double x_min;
    double x_max;
    double y_min;
    double y_max;
} position_t;

typedef struct state_s {
    SDL_Window* window;
    SDL_Surface* surface;
    SDL_Renderer* renderer;
} state_t;

// math.c
int mandelbrot_iterations(double cr, double ci, int max_iter);
void calculate_points(position_t* pos);
void mandelbrot_at_point(double cr, double ci, int* iter_out, double* zr_out, double* zi_out);

// draw.c
// TODO: color struct or something
void get_color(int iter, int max_iter, int* r, int* g, int* b);
void draw_points(SDL_Surface* surface);

#endif