aboutsummaryrefslogtreecommitdiff
path: root/header.h
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2019-08-27 17:24:45 +0200
committerCharles <sircharlesaze@gmail.com>2019-08-27 17:24:45 +0200
commit7c48d434f0a68ac47ebe1bd66daa2c86842979c7 (patch)
tree9cf10fa6fe88a68038eebd5ff09cc550a7fb15b7 /header.h
parent60adb6e2f051ab72fb66541a8f48ef195317d403 (diff)
downloadmandelbrot_cpu-7c48d434f0a68ac47ebe1bd66daa2c86842979c7.tar.gz
mandelbrot_cpu-7c48d434f0a68ac47ebe1bd66daa2c86842979c7.tar.bz2
mandelbrot_cpu-7c48d434f0a68ac47ebe1bd66daa2c86842979c7.zip
SDL boilerplate window
init, quit and run functions. Error handling.
Diffstat (limited to 'header.h')
-rw-r--r--header.h25
1 files changed, 23 insertions, 2 deletions
diff --git a/header.h b/header.h
index e46ce7e..855cff3 100644
--- a/header.h
+++ b/header.h
@@ -1,9 +1,30 @@
#ifndef HEADER_H
# define HEADER_H
-#include <complex.h>
+# include <stdbool.h>
+# include <complex.h>
+# include <SDL2/SDL.h>
-double mandelbrot_in_set(double complex c);
+typedef struct
+{
+ SDL_Window *window;
+ SDL_Renderer *renderer;
+ bool running;
+} GState;
+
+typedef struct
+{
+ int window_width;
+ int window_height;
+} GConf;
+
+// mandelbrot.c
+double mandelbrot_in_set(double _Complex c);
void mandelbrot_print(void);
+// graphics.c
+GState *graphics_init(GConf *conf);
+void graphics_quit(GState *state);
+void graphics_run(GState *state);
+
#endif