mightymandel v16

GPU-based Mandelbrot set explorer

render.h
Go to the documentation of this file.
1 // mightymandel -- GPU-based Mandelbrot Set explorer
2 // Copyright (C) 2012,2013,2014,2015 Claude Heiland-Allen
3 // License GPL3+ http://www.gnu.org/licenses/gpl.html
4 
5 #ifndef RENDER_H
6 #define RENDER_H 1
7 
13 #include "fp32_fillc.h"
14 #include "fp32_colour.h"
15 #include "fp32_init.h"
16 #include "fp32_step.h"
17 #include "fp32_unescaped.h"
18 #include "fp32_escaped.h"
19 #include "fp64_init.h"
20 #include "fp64_step.h"
21 #include "fp64_unescaped.h"
22 #include "fp64_escaped.h"
23 #include "fpxx_init.h"
24 #include "fpxx_approx.h"
25 #include "fpxx_step.h"
26 #include "fpxx_unescaped.h"
27 #include "fpxx_escaped.h"
28 #include "ref_set.h"
29 #include "blob_set.h"
30 #include "completion.h"
31 #include "stopwatch.h"
32 #include "poll.h"
33 #include "slice.h"
34 
35 extern const char *render_method_name[3];
36 
44  bool calculate_de;
46  mpfr_t centerx;
47  mpfr_t centery;
48  mpfr_t radius;
49  double weight;
50  double max_glitch;
51  int max_blob;
52  double sharpness;
53  bool show_de;
56  int width;
57  int height;
58  int win_width;
59  int win_height;
60  int slice;
61  char *filename;
62 };
63 
64 void render_options_init(struct render_options *o);
65 void render_options_end(struct render_options *o);
66 void render_options_copy(struct render_options *o, const struct render_options *p);
67 void render_options_set_location(struct render_options *o, const mpfr_t cx, const mpfr_t cy, const mpfr_t r);
68 
69 struct render; // forward declaration
70 struct idlefunc_t { void (*f)(struct render *); };
71 
75 };
76 
82 struct render {
83  bool begun;
85  struct idlefunc_t idle;
86  double escaperadius2;
87  GLuint rgb_tex;
88  GLuint tex;
89  GLuint tex2;
90  GLuint fbo;
91  GLuint query;
92  GLuint vbo[2];
93  GLuint active_count;
109  int pass;
110  struct ref_set *refs;
111  struct blob_set *blobs;
115  bool slice_done;
116  bool done;
117  bool all_done;
118  bool aborted;
119  bool timeout;
122  int slice_n;
123  struct poll *poll;
124 };
125 
126 void render_begin(struct render *s);
127 void render_end(struct render *s);
128 void render_start(struct render *s, const struct render_options *o);
129 bool render_calculate(struct render *s, const struct render_options *o, struct poll *poll);
130 bool render_display(struct render *s, const struct render_options *o, struct poll *poll);
131 bool render_reshape(struct render *s, int new_width, int new_height, int new_slice, GLsizei *bytes_allocated);
132 
134 
135 #endif