erebus
view 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 |
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"
10 struct Option {
11 enum Type { INT, FLOAT, VEC } type;
12 int ival;
13 float fval;
14 Vector4 vval;
15 };
17 struct Rect {
18 int x, y, width, height;
20 bool operator ==(const Rect &r) const;
21 bool operator !=(const Rect &r) const;
22 };
24 struct erebus {
25 Scene *scn;
27 Image<float> fbimg;
28 Image<float> accum; // sample accumulator per pixel
29 Option options[ERB_NUM_OPTIONS];
31 // render state
32 float inv_gamma;
33 long cur_time;
34 int cur_pixel_x, cur_pixel_y;
35 Rect cur_rect;
36 int cur_sample;
38 // interactive input
39 std::vector<bool> keystate;
40 std::vector<bool> bnstate;
41 int mouse_pos[2];
43 // debugging stuff
44 int dbg_nodesel;
45 };
47 float randf(float low = 0.0f, float high = 1.0f);
49 #endif // EREBUS_IMPL_H_