… | |
… | |
68 | return true; |
68 | return true; |
69 | } |
69 | } |
70 | |
70 | |
71 | void view::reset_projection () |
71 | void view::reset_projection () |
72 | { |
72 | { |
73 | //renormalize (orig, p); |
73 | renormalize (orig, p); |
74 | |
74 | |
75 | glViewport (0, 0, w, h); |
75 | glViewport (0, 0, w, h); |
76 | |
76 | |
77 | glMatrixMode (GL_PROJECTION); |
77 | glMatrixMode (GL_PROJECTION); |
78 | glLoadIdentity (); |
78 | glLoadIdentity (); |
… | |
… | |
115 | void view::begin () |
115 | void view::begin () |
116 | { |
116 | { |
117 | glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); |
117 | glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); |
118 | glDepthRange (0, 1. - (1. / pow (2., 16.))); |
118 | glDepthRange (0, 1. - (1. / pow (2., 16.))); |
119 | |
119 | |
120 | vismap.clear (); |
|
|
121 | vislist.clear (); |
120 | vislist.clear (); |
122 | |
121 | |
123 | generation++; |
122 | generation++; |
124 | |
123 | |
125 | reset_projection (); |
124 | reset_projection (); |
… | |
… | |
148 | reset_projection (); |
147 | reset_projection (); |
149 | } |
148 | } |
150 | |
149 | |
151 | void view::end () |
150 | void view::end () |
152 | { |
151 | { |
153 | vismap.clear (); |
152 | vislist.clear (); |
154 | } |
153 | } |
155 | |
154 | |
156 | void view::pass (enum mode m) |
155 | void view::pass (enum mode m) |
157 | { |
156 | { |
158 | mode = m; |
157 | mode = m; |
… | |
… | |
179 | cgGLEnableProfile (vsh_profile); |
178 | cgGLEnableProfile (vsh_profile); |
180 | cgGLEnableProfile (fsh_profile); |
179 | cgGLEnableProfile (fsh_profile); |
181 | } |
180 | } |
182 | |
181 | |
183 | for (vector<octant *>::iterator i = vislist.begin (); i != vislist.end (); ++i) |
182 | for (vector<octant *>::iterator i = vislist.begin (); i != vislist.end (); ++i) |
|
|
183 | { |
|
|
184 | visibility_state &vs = vismap[*i]; |
|
|
185 | bool oq = (vs.visibility == visibility_state::PARTIAL |
|
|
186 | || vs.visibility == visibility_state::FULL) |
|
|
187 | && (vs.last + 1. < timer.now) |
|
|
188 | && (mode == LIGHTED); |
|
|
189 | |
|
|
190 | if (oq) |
|
|
191 | begin_occ_query (**i); |
|
|
192 | |
184 | (*i)->display (*this); |
193 | (*i)->display (*this); |
|
|
194 | |
|
|
195 | if (oq) |
|
|
196 | end_occ_query (); |
|
|
197 | |
|
|
198 | } |
185 | |
199 | |
186 | drawn.clear (); |
200 | drawn.clear (); |
187 | |
201 | |
188 | if (mode == view::DEPTH) |
202 | if (mode == view::DEPTH) |
189 | { |
203 | { |