ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libgender/view.h
Revision: 1.9
Committed: Tue Oct 5 03:52:13 2004 UTC (19 years, 8 months ago) by root
Content type: text/plain
Branch: MAIN
CVS Tags: knowngood
Changes since 1.8: +2 -0 lines
Log Message:
*** empty log message ***

File Contents

# Content
1 #ifndef VIEW_H
2 #define VIEW_H
3
4 #include <set>
5 #include <map>
6
7 using namespace std;
8
9 #include "util.h"
10
11 struct view {
12 sector orig;
13 point p;
14 vec3 d, u;
15 float fov;
16 int w, h;
17
18 void draw (draw_context &ctx);
19 };
20
21 struct visibility_state {
22 unsigned int generation;
23 enum { UNKNOWN, OCCLUDED, PARTIAL, FULL } visibility;
24
25 visibility_state () : generation(0), visibility(UNKNOWN) { };
26 };
27
28 struct draw_context {
29 view &v;
30
31 matrix projection;
32 matrix modelview;
33
34 void transform (const matrix &m);
35
36 struct {
37 plane l, r, t, b, n, f;
38 } frustum;
39 enum { DEPTH, LIGHTED } mode;
40 light *l;
41 set<entity_base *> drawn;
42
43 unsigned int generation;
44 map<octant *, visibility_state> vismap;
45 vector<octant *> vislist; // octants partially or fully visible
46 vector<octant *> checklist; // octants possibly visible
47
48 bool may_draw (entity_base *e);
49
50 draw_context (view &v);
51 ~draw_context ();
52 };
53
54 #endif
55