00001 /********************************************************************** 00002 * creases_texture.C 00003 **********************************************************************/ 00004 00005 00006 #include "geom/gl_view.H" 00007 #include "creases_texture.H" 00008 00009 /********************************************************************** 00010 * CreasesTexture: 00011 **********************************************************************/ 00012 int 00013 CreasesTexture::draw(CVIEWptr& v) 00014 { 00015 if (_ctrl) 00016 return _ctrl->draw(v); 00017 00018 // set line width, init line smoothing, and push attributes: 00019 GL_VIEW::init_line_smooth(GLfloat(v->line_scale()*_width), GL_CURRENT_BIT); 00020 00021 GL_COL(_color, alpha()); // GL_CURRENT_BIT 00022 glDisable(GL_LIGHTING); // GL_ENABLE_BIT 00023 00024 // draw creases (not view-dependent) 00025 if (!BasicTexture::draw(v)) { 00026 00027 int dl = _dl.get_dl(v, 1, _patch->stamp()); 00028 if (dl) 00029 glNewList(dl, GL_COMPILE); 00030 00031 _patch->draw_crease_strips(_cb); 00032 00033 // restore gl state: 00034 GL_VIEW::end_line_smooth(); 00035 00036 // end the display list here 00037 if (_dl.dl(v)) { 00038 _dl.close_dl(v); 00039 00040 // the display list is built; now execute it 00041 BasicTexture::draw(v); 00042 } 00043 } 00044 00045 return 1; 00046 } 00047 00048 /* end of file creases_texture.C */