diff options
author | cxp2249 <moritz.pirk@tuhh.de> | 2018-01-27 02:35:54 +0100 |
---|---|---|
committer | cxp2249 <moritz.pirk@tuhh.de> | 2018-01-27 02:35:54 +0100 |
commit | f72c4f122ccd832031925974ff521955e0e9b17c (patch) | |
tree | 02766a38371000ced0e2cb109f4e6a7f5c97a61c /src/render_cpu.h | |
parent | cbac1496b1c8023a7fdede63e9556f2de82bbafe (diff) | |
parent | c8a38bd8ad66eb0b35f08a4733fdee37a888b83c (diff) |
Merge branch 'master' of https://collaborating.tuhh.de/cev7691/mandelbrot-zoom
Diffstat (limited to 'src/render_cpu.h')
-rw-r--r-- | src/render_cpu.h | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/src/render_cpu.h b/src/render_cpu.h new file mode 100644 index 0000000..7abbdc4 --- /dev/null +++ b/src/render_cpu.h @@ -0,0 +1,61 @@ +/* + * render_cpu.h + * + * Created on: 25.01.2018 + * Author: Superleo1810 + */ + +#ifndef RENDER_CPU_H_ +#define RENDER_CPU_H_ + +#include "defs.h" +#include <stdlib.h> +#include <GL/glut.h> +#include <pthread.h> +#include <time.h> +#include <math.h> + +#define COORDS(x, y, width) ((y)*(width)+(x)) + +typedef struct config_cpu { + u8 threads; + GLuint tex; + u32 *arr; + d64 (*zoom_func)(d64, d64); + u32 (*set_func)(d64, d64, u32); + u32 iterations; + u32 colorFrom; + u32 colorTo; + d64 to_x; + d64 to_y; + d64 speed; + u16 width; + u16 height; + u8 renderFPS; +} CpuConfig; + +typedef struct t_args { + u8 tc; + u8 tid; + d64 x_min; + d64 x_max; + d64 y_min; + d64 y_max; + u32 (*sfunc) (d64, d64, u32); + u32 *arr; +} ThreadArgs; + +CpuConfig *config_cpu; +u32 rendercnt; +float ft; + +d64 x_min, x_max, y_min, y_max; +d64 x_min_s, x_max_s, y_min_s, y_max_s; + +void init_cpu(CpuConfig *config); +void render_cpu(void); +void idle_cpu(void); +void calculate(d64 x_min, d64 y_min, d64 x_max, d64 y_max, u32 (*sfunc) (d64, d64, u32), u32 *arr); +void calculate_t(void *args); + +#endif /* RENDER_CPU_H_ */ |