erebus
view liberebus/src/erebus_impl.h @ 24:4336acf8389d
implemented thread pool. not using it yet.
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Fri, 30 May 2014 06:56:44 +0300 |
parents | e9da2916bc79 |
children | c8a6fb04fefa |
line source
1 #ifndef EREBUS_IMPL_H_
2 #define EREBUS_IMPL_H_
4 #include <vector>
5 #include <vmath/vmath.h>
6 #include "erebus.h"
7 #include "image.h"
8 #include "scene.h"
9 #include "threadpool.h"
11 struct Option {
12 enum Type { INT, FLOAT, VEC } type;
13 int ival;
14 float fval;
15 Vector4 vval;
16 };
18 struct Rect {
19 int x, y, width, height;
21 bool operator ==(const Rect &r) const;
22 bool operator !=(const Rect &r) const;
23 };
25 struct erebus {
26 Scene *scn;
28 Image<float> fbimg;
29 Image<float> accum; // sample accumulator per pixel
30 Option options[ERB_NUM_OPTIONS];
32 ThreadPool tpool;
34 // render state
35 float inv_gamma;
36 long cur_time;
37 int cur_pixel_x, cur_pixel_y;
38 Rect cur_rect;
39 int cur_sample;
41 // interactive input
42 std::vector<bool> keystate;
43 std::vector<bool> bnstate;
44 int mouse_pos[2];
46 // debugging stuff
47 int dbg_nodesel;
48 };
50 float randf(float low = 0.0f, float high = 1.0f);
52 #endif // EREBUS_IMPL_H_