#ifndef MANDELBROT_H
#define MANDELBROT_H

#include <SDL2/SDL.h>
#include <SDL2/SDL_render.h>

#define SCREEN_WIDTH 640
#define SCREEN_HEIGHT 480
#define MAX_ITERATIONS 250

typedef struct {
    long double real;
    long double imag;
} Complex;

typedef struct{
    SDL_Window *window;
    SDL_Renderer *renderer;
    SDL_Texture *texture;
    int win_height;
    int win_width;
    short unsigned int needs_recalc;
    short unsigned int draw_ui;
} App ;

typedef struct{
    double x_min;
    double x_max;
    double y_min;
    double y_max;
    double zoom;
} ViewInfo ;

typedef struct{
    int dragging;
    int start_x;
    int start_y;
    ViewInfo original_view;
} Mouse ;

void render(App *app, ViewInfo view, int start_x, int end_x, int start_y, int end_y);

#endif
