ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libgender/view.C
(Generate patch)

Comparing libgender/view.C (file contents):
Revision 1.51 by root, Sat Oct 16 12:33:46 2004 UTC vs.
Revision 1.52 by root, Sat Oct 16 14:48:48 2004 UTC

186{ 186{
187 mode = m; 187 mode = m;
188 188
189 glDisable (GL_ALPHA_TEST); 189 glDisable (GL_ALPHA_TEST);
190 glDisable (GL_BLEND); 190 glDisable (GL_BLEND);
191 //glDisable (GL_DEPTH_TEST);
192 191
193 if (mode == view::DEPTH) 192 switch (mode)
194 { 193 {
194 case DEPTH:
195 //glEnable (GL_POLYGON_OFFSET_FILL); 195 //glEnable (GL_POLYGON_OFFSET_FILL);
196 //glPolygonOffset (0, 5); 196 //glPolygonOffset (0, 5);
197 glDisable (GL_MINMAX);
197 glDepthRange (DEPTH_OFFSET, 1.); 198 glDepthRange (DEPTH_OFFSET, 1.);
198 glDepthFunc (GL_LESS); 199 glDepthFunc (GL_LESS);
200 glEnable (GL_DEPTH_TEST);
199 glDisable (GL_LIGHTING); 201 glDisable (GL_LIGHTING);
200 glColorMask (0, 0, 0, 0); 202 glColorMask (0, 0, 0, 0);
201 } 203 glDepthMask (1);
202 else 204 break;
203 { 205
206 case POSTDEPTH:
207 glEnable (GL_DEPTH_TEST);
208 glColorMask (0, 0, 0, 0);
209 glDepthMask (0);
210 break;
211
212 case LIGHTED:
204 glEnable (GL_MINMAX); 213 glEnable (GL_MINMAX);
205 //glDisable (GL_POLYGON_OFFSET_FILL); 214 //glDisable (GL_POLYGON_OFFSET_FILL);
206 glDepthRange (0., 1. - DEPTH_OFFSET); 215 glDepthRange (0., 1. - DEPTH_OFFSET);
207 glDepthFunc (GL_LESS); 216 glDepthFunc (GL_LESS);
217 glColorMask (1, 1, 1, 0);
208 glDepthMask (0); 218 glDepthMask (0);
219 break;
209 } 220 }
210 221
211 for (vector<octant *>::iterator i = vislist.begin (); i != vislist.end (); ++i) 222 for (vector<octant *>::iterator i = vislist.begin (); i != vislist.end (); ++i)
212 { 223 (*i)->display (*this);
213 octant *o = *i; 224
225 drawn.clear ();
214 226
215#if 0 227#if 0
216 visibility_state &vs = vismap[o];
217 bool oq = mode == LIGHTED
218 && vs.last + 1. < timer.now
219 && (vs.visibility == visibility_state::PARTIAL
220 || vs.visibility == visibility_state::FULL);
221#endif
222 bool oq = false;
223
224 if (oq)
225 begin_occ_query (*o);
226
227 o->display (*this);
228
229 if (oq) // && o->fill) WHY???
230 {
231 glColorMask (0, 0, 0, 0);
232 o->draw_bbox (*this);
233 glColorMask (1, 1, 1, 0);
234 }
235
236 if (oq)
237 end_occ_query ();
238 }
239
240 drawn.clear ();
241
242 if (mode == view::DEPTH) 228 if (mode == view::DEPTH)
243 { 229 {
244 glEnable (GL_DEPTH_CLAMP_NV); 230 glEnable (GL_DEPTH_CLAMP_NV);
245 glDepthMask (0); 231 glDepthMask (0);
246 glDepthFunc (GL_LESS); 232 glDepthFunc (GL_LESS);
252 end_occ_query (); 238 end_occ_query ();
253 } 239 }
254 240
255 glDisable (GL_DEPTH_CLAMP_NV); 241 glDisable (GL_DEPTH_CLAMP_NV);
256 } 242 }
257 243#endif
258 glColorMask (1, 1, 1, 0);
259 glDepthMask (1);
260} 244}
261 245
262 246

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines