… | |
… | |
30 | occ_query (view &ctx, void *id, GLuint count) : ctx(ctx), id(id), count(count) { }; |
30 | occ_query (view &ctx, void *id, GLuint count) : ctx(ctx), id(id), count(count) { }; |
31 | }; |
31 | }; |
32 | |
32 | |
33 | typedef event_receiver<void, occ_query> recv_occ_query; |
33 | typedef event_receiver<void, occ_query> recv_occ_query; |
34 | |
34 | |
|
|
35 | struct pass |
|
|
36 | { |
|
|
37 | struct light *l; |
|
|
38 | |
|
|
39 | pass (light *l) : l(l) { } |
|
|
40 | }; |
|
|
41 | |
|
|
42 | extern pass pass_depth; |
|
|
43 | |
35 | struct view |
44 | struct view |
36 | { |
45 | { |
37 | sector orig; |
46 | sector orig; |
38 | point p; |
47 | point p; |
39 | vec3 d, u; |
48 | vec3 d, u; |
… | |
… | |
58 | cone c; |
67 | cone c; |
59 | sphere s; |
68 | sphere s; |
60 | } frustum; |
69 | } frustum; |
61 | |
70 | |
62 | // the passes |
71 | // the passes |
63 | enum pass { |
72 | enum pass_type { |
64 | DEPTH, // mandatory, render depth only |
73 | DEPTH, // mandatory, render depth only |
65 | POSTDEPTH, // mandatory, occ tests or ignored |
74 | POSTDEPTH, // mandatory, occ tests or ignored |
66 | LIGHTED, // optional, render faces in full glory |
75 | LIGHTED, // optional, render faces in full glory |
67 | } pass; |
76 | } pass_type; |
|
|
77 | |
|
|
78 | pass *pass_data; |
68 | |
79 | |
69 | set<const entity *> drawn; // TODO: put drawn info and octant+entity visibility info into vismap! |
80 | set<const entity *> drawn; // TODO: put drawn info and octant+entity visibility info into vismap! |
70 | |
81 | |
71 | unsigned int generation; |
82 | unsigned int generation; |
72 | typedef map<visible *, visibility_base *> visibility_map; |
83 | typedef map<visible *, visibility_base *> visibility_map; |
… | |
… | |
88 | void reset_projection (); |
99 | void reset_projection (); |
89 | |
100 | |
90 | // public |
101 | // public |
91 | |
102 | |
92 | void begin (); |
103 | void begin (); |
93 | void render (enum pass p); |
104 | void render (enum pass_type p, pass &data); |
94 | void end (); |
105 | void end (); |
95 | |
106 | |
96 | bool may_draw (const entity *e); |
107 | bool may_draw (const entity *e); |
97 | |
108 | |
98 | view (); |
109 | view (); |
99 | ~view (); |
110 | ~view (); |
100 | }; |
111 | }; |
101 | |
112 | |
|
|
113 | struct light : view |
|
|
114 | { |
|
|
115 | colour c; |
|
|
116 | GLfloat intensity; |
|
|
117 | GLfloat radius; |
|
|
118 | }; |
|
|
119 | |
102 | #endif |
120 | #endif |
103 | |
121 | |