diff options
Diffstat (limited to 'src/render.h')
-rw-r--r-- | src/render.h | 45 |
1 files changed, 33 insertions, 12 deletions
diff --git a/src/render.h b/src/render.h index d9850fd..83a5c1a 100644 --- a/src/render.h +++ b/src/render.h @@ -8,14 +8,22 @@ #ifndef RENDER_H_ #define RENDER_H_ -#include <gtk/gtk.h> +#define COORDS(x, y, width) ((y)*(width)+(x)) + #include "defs.h" +#include <stdlib.h> +#include <GL/glut.h> +#include <pthread.h> +#include <math.h> typedef struct config { u32 iterations; + u8 threads; u32 colorFrom; u32 colorTo; - bool video; + long double to_x; + long double to_y; + u8 video; u8 filetype; u16 width; u16 height; @@ -26,20 +34,33 @@ typedef struct config { // TODO: key mapping als option in die struct } Config; -typedef struct Ui_render { - GtkWindow *window; - GtkFrame *frame; - GtkDrawingArea *drawing_area; -} Ui_render; +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; -Ui_render ui_render; -u32 (*_sfunc) (double, double, u32); +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) (double, double, u32)); +void render_init(Config *config, u32 (*sfunc) (long double, long double, u32)); void render_show(); -cairo_surface_t *render_surface(); +void gl_render(void); +void gl_idle(void); -void on_draw(GtkWidget *widget, cairo_t *cr, gpointer data); +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); #endif /* RENDER_H_ */ |