From 7c48d434f0a68ac47ebe1bd66daa2c86842979c7 Mon Sep 17 00:00:00 2001 From: Charles Date: Tue, 27 Aug 2019 17:24:45 +0200 Subject: SDL boilerplate window init, quit and run functions. Error handling. --- header.h | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'header.h') 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 +# include +# include +# include -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 -- cgit