erebus
annotate liberebus/src/erebus_impl.h @ 17:e9da2916bc79
fixed the normal bug
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Mon, 26 May 2014 05:41:28 +0300 |
parents | 474a0244f57d |
children | 4336acf8389d |
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@17 | 9 |
nuclear@17 | 10 struct Option { |
nuclear@17 | 11 enum Type { INT, FLOAT, VEC } type; |
nuclear@17 | 12 int ival; |
nuclear@17 | 13 float fval; |
nuclear@17 | 14 Vector4 vval; |
nuclear@17 | 15 }; |
nuclear@17 | 16 |
nuclear@17 | 17 struct Rect { |
nuclear@17 | 18 int x, y, width, height; |
nuclear@17 | 19 |
nuclear@17 | 20 bool operator ==(const Rect &r) const; |
nuclear@17 | 21 bool operator !=(const Rect &r) const; |
nuclear@17 | 22 }; |
nuclear@17 | 23 |
nuclear@17 | 24 struct erebus { |
nuclear@17 | 25 Scene *scn; |
nuclear@17 | 26 |
nuclear@17 | 27 Image<float> fbimg; |
nuclear@17 | 28 Image<float> accum; // sample accumulator per pixel |
nuclear@17 | 29 Option options[ERB_NUM_OPTIONS]; |
nuclear@17 | 30 |
nuclear@17 | 31 // render state |
nuclear@17 | 32 float inv_gamma; |
nuclear@17 | 33 long cur_time; |
nuclear@17 | 34 int cur_pixel_x, cur_pixel_y; |
nuclear@17 | 35 Rect cur_rect; |
nuclear@17 | 36 int cur_sample; |
nuclear@17 | 37 |
nuclear@17 | 38 // interactive input |
nuclear@17 | 39 std::vector<bool> keystate; |
nuclear@17 | 40 std::vector<bool> bnstate; |
nuclear@17 | 41 int mouse_pos[2]; |
nuclear@17 | 42 |
nuclear@17 | 43 // debugging stuff |
nuclear@17 | 44 int dbg_nodesel; |
nuclear@17 | 45 }; |
nuclear@17 | 46 |
nuclear@2 | 47 float randf(float low = 0.0f, float high = 1.0f); |
nuclear@2 | 48 |
nuclear@2 | 49 #endif // EREBUS_IMPL_H_ |