… | |
… | |
4 | |
4 | |
5 | #include "view.h" |
5 | #include "view.h" |
6 | #include "oct.h" |
6 | #include "oct.h" |
7 | |
7 | |
8 | using namespace gl; |
8 | using namespace gl; |
|
|
9 | |
|
|
10 | pass pass_depth (0); |
9 | |
11 | |
10 | vector<GLuint> occ_query_objects; |
12 | vector<GLuint> occ_query_objects; |
11 | |
13 | |
12 | static GLuint begin_occ_query () |
14 | static GLuint begin_occ_query () |
13 | { |
15 | { |
… | |
… | |
182 | vislist.clear (); |
184 | vislist.clear (); |
183 | } |
185 | } |
184 | |
186 | |
185 | #define DEPTH_OFFSET (1. / (GLdouble)(1L << 16)) |
187 | #define DEPTH_OFFSET (1. / (GLdouble)(1L << 16)) |
186 | |
188 | |
187 | void view::render (enum pass p) |
189 | void view::render (enum pass_type p, pass &data) |
188 | { |
190 | { |
189 | pass = p; |
191 | pass_type = p; |
|
|
192 | pass_data = &data; |
190 | |
193 | |
191 | switch (pass) |
194 | switch (pass_type) |
192 | { |
195 | { |
193 | case DEPTH: |
196 | case DEPTH: |
194 | glColorMask (1, 1, 1, 1); |
197 | glColorMask (1, 1, 1, 1); |
195 | glDepthMask (1); |
198 | glDepthMask (1); |
196 | |
199 | |
… | |
… | |
246 | } |
249 | } |
247 | |
250 | |
248 | for (vector<octant *>::iterator i = vislist.begin (); i != vislist.end (); ++i) |
251 | for (vector<octant *>::iterator i = vislist.begin (); i != vislist.end (); ++i) |
249 | (*i)->display (*this); |
252 | (*i)->display (*this); |
250 | |
253 | |
251 | if (pass == LIGHTED) |
254 | if (pass_type == DEPTH) |
252 | printf ("fps %f NF %f:%f vis %d CAM (%d,%d,%d)\n", timer.fps, z_near, z_far, drawn.size (), orig.x, orig.y, orig.z);//D |
255 | printf ("fps %f NF %f:%f vis %d CAM (%d,%d,%d)\n", timer.fps, z_near, z_far, drawn.size (), orig.x, orig.y, orig.z);//D |
253 | |
256 | |
254 | drawn.clear (); |
257 | drawn.clear (); |
255 | |
258 | |
256 | #if 0 |
259 | #if 0 |