erebus

annotate liberebus/src/erebus_impl.h @ 47:4b91c9a501d8

minor fix of strange code structure in the thread func
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 01 Feb 2016 14:56:15 +0200
parents 9d6368850fe1
children c4d48a21bc4a
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@45 5 #include <gmath/gmath.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@26 18 struct Block {
nuclear@17 19 int x, y, width, height;
nuclear@26 20 int sample;
nuclear@26 21 int frame;
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@31 31 ThreadPool *tpool;
nuclear@24 32
nuclear@17 33 // render state
nuclear@40 34 bool rendering;
nuclear@17 35 float inv_gamma;
nuclear@17 36 long cur_time;
nuclear@17 37 int cur_sample;
nuclear@26 38 int cur_frame;
nuclear@17 39
nuclear@17 40 // interactive input
nuclear@17 41 std::vector<bool> keystate;
nuclear@17 42 std::vector<bool> bnstate;
nuclear@17 43 int mouse_pos[2];
nuclear@17 44
nuclear@17 45 // debugging stuff
nuclear@17 46 int dbg_nodesel;
nuclear@17 47 };
nuclear@17 48
nuclear@2 49 float randf(float low = 0.0f, float high = 1.0f);
nuclear@2 50
nuclear@2 51 #endif // EREBUS_IMPL_H_