aboutsummaryrefslogtreecommitdiff
path: root/src/render.h
diff options
context:
space:
mode:
authorcxp2249 <moritz.pirk@tuhh.de>2018-01-27 02:35:54 +0100
committercxp2249 <moritz.pirk@tuhh.de>2018-01-27 02:35:54 +0100
commitf72c4f122ccd832031925974ff521955e0e9b17c (patch)
tree02766a38371000ced0e2cb109f4e6a7f5c97a61c /src/render.h
parentcbac1496b1c8023a7fdede63e9556f2de82bbafe (diff)
parentc8a38bd8ad66eb0b35f08a4733fdee37a888b83c (diff)
Merge branch 'master' of https://collaborating.tuhh.de/cev7691/mandelbrot-zoom
Diffstat (limited to 'src/render.h')
-rw-r--r--src/render.h44
1 files changed, 8 insertions, 36 deletions
diff --git a/src/render.h b/src/render.h
index dde79be..a50027a 100644
--- a/src/render.h
+++ b/src/render.h
@@ -8,60 +8,32 @@
#ifndef RENDER_H_
#define RENDER_H_
-#define COORDS(x, y, width) ((y)*(width)+(x))
-
#include "defs.h"
-#include <stdlib.h>
-#include <GL/glut.h>
-#include <pthread.h>
+#include "render_opencl.h"
+#include "render_cpu.h"
#include <math.h>
typedef struct config {
- u32 iterations;
- u8 threads;
- u32 colorFrom;
- u32 colorTo;
- long double to_x;
- long double to_y;
- long double speed;
+ CpuConfig config_cpu;
+ OpenCLConfig config_opencl;
+ u8 mode;
u8 video;
u8 filetype;
u16 width;
u16 height;
- u8 renderFPS;
u8 videoFPS;
u32 bitrate;
const char *path;
// TODO: key mapping als option in die struct
} Config;
-typedef struct t_args {
- u8 tc;
- u8 tid;
- long double x_min;
- long double x_max;
- long double y_min;
- long double y_max;
- u32 (*sfunc) (long double, long double, u32);
- u32 *arr;
-} ThreadArgs;
-
Config *_config;
-u32 (*_sfunc) (long double, long double, u32);
u32 *s_arr;
GLuint tex;
-u32 rendercnt;
-long double x_min, x_max, y_min, y_max;
-long double x_min_s, x_max_s, y_min_s, y_max_s;
-int delta;
-long double dt, ft;
-void render_init(Config *config, u32 (*sfunc) (long double, long double, u32));
-void render_show();
-void gl_render(void);
-void gl_idle(void);
+d64 zoom_func(d64 ft, d64 s);
-void calculate(long double x_min, long double y_min, long double x_max, long double y_max, u32 (*sfunc) (long double, long double, u32), u32 *arr);
-void calculate_t(void *args);
+void init_render(Config *config);
+void show_render();
#endif /* RENDER_H_ */