erebus
annotate 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 |
rev | line source |
---|---|
nuclear@2 | 1 #ifndef EREBUS_IMPL_H_ |
nuclear@2 | 2 #define EREBUS_IMPL_H_ |
nuclear@2 | 3 |
nuclear@17 | 4 #include <vector> |
nuclear@17 | 5 #include <vmath/vmath.h> |
nuclear@17 | 6 #include "erebus.h" |
nuclear@17 | 7 #include "image.h" |
nuclear@17 | 8 #include "scene.h" |
nuclear@24 | 9 #include "threadpool.h" |
nuclear@17 | 10 |
nuclear@17 | 11 struct Option { |
nuclear@17 | 12 enum Type { INT, FLOAT, VEC } type; |
nuclear@17 | 13 int ival; |
nuclear@17 | 14 float fval; |
nuclear@17 | 15 Vector4 vval; |
nuclear@17 | 16 }; |
nuclear@17 | 17 |
nuclear@17 | 18 struct Rect { |
nuclear@17 | 19 int x, y, width, height; |
nuclear@17 | 20 |
nuclear@17 | 21 bool operator ==(const Rect &r) const; |
nuclear@17 | 22 bool operator !=(const Rect &r) const; |
nuclear@17 | 23 }; |
nuclear@17 | 24 |
nuclear@17 | 25 struct erebus { |
nuclear@17 | 26 Scene *scn; |
nuclear@17 | 27 |
nuclear@17 | 28 Image<float> fbimg; |
nuclear@17 | 29 Image<float> accum; // sample accumulator per pixel |
nuclear@17 | 30 Option options[ERB_NUM_OPTIONS]; |
nuclear@17 | 31 |
nuclear@24 | 32 ThreadPool tpool; |
nuclear@24 | 33 |
nuclear@17 | 34 // render state |
nuclear@17 | 35 float inv_gamma; |
nuclear@17 | 36 long cur_time; |
nuclear@17 | 37 int cur_pixel_x, cur_pixel_y; |
nuclear@17 | 38 Rect cur_rect; |
nuclear@17 | 39 int cur_sample; |
nuclear@17 | 40 |
nuclear@17 | 41 // interactive input |
nuclear@17 | 42 std::vector<bool> keystate; |
nuclear@17 | 43 std::vector<bool> bnstate; |
nuclear@17 | 44 int mouse_pos[2]; |
nuclear@17 | 45 |
nuclear@17 | 46 // debugging stuff |
nuclear@17 | 47 int dbg_nodesel; |
nuclear@17 | 48 }; |
nuclear@17 | 49 |
nuclear@2 | 50 float randf(float low = 0.0f, float high = 1.0f); |
nuclear@2 | 51 |
nuclear@2 | 52 #endif // EREBUS_IMPL_H_ |