/[libvob]/libvob/src/lines/Lines.cxx
ViewVC logotype

Diff of /libvob/src/lines/Lines.cxx

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.7 by mudyc, Fri Aug 22 12:33:40 2003 UTC revision 1.8 by mudyc, Fri Aug 22 13:19:54 2003 UTC
# Line 26  Lines.cxx Line 26  Lines.cxx
26    
27    
28  #include <vob/lines/Lines.hxx>  #include <vob/lines/Lines.hxx>
29    #include <vob/glerr.hxx>
30  #include <cmath>  #include <cmath>
31    
32  static bool dbg = true;  static bool dbg = true;
# Line 44  namespace Lines { Line 45  namespace Lines {
45            cout << "Errorr in SimpleLine - not enough points!"<< points.size() <<"\n";            cout << "Errorr in SimpleLine - not enough points!"<< points.size() <<"\n";
46            return;            return;
47          }          }
48          draw(points[0], points[1]);          this->points = points;
49      }      }
50    
51    
# Line 76  namespace Lines { Line 77  namespace Lines {
77       *       *
78       *   t0 = 0.5 - (4+w)/16w       *   t0 = 0.5 - (4+w)/16w
79       */       */
80        void SimpleLine::draw() {
81            ZPt a = points[0];
82            ZPt b = points[1];
83    
84      void SimpleLine::draw(ZPt a, ZPt b) {          if (dbg) cout << "lineWidth: " <<linewidth
85          if (dbg) cout << "lineWidth: " <<linewidth << "\n";                        <<" x: "<< a.x << ", "<< b.x
         if (dbg) cout <<" x: "<< a.x << ", "<< b.x  
86                        <<" y: "<< a.y << ", "<< b.y <<"\n";                        <<" y: "<< a.y << ", "<< b.y <<"\n";
87            
88          glPushAttrib(GL_ENABLE_BIT);          glPushAttrib(GL_ENABLE_BIT);
89            glDisable(GL_TEXTURE_2D);            glDisable(GL_TEXTURE_1D);
90            glEnable(GL_TEXTURE_1D);            glEnable(GL_TEXTURE_2D);
91    
92          glEnable(GL_BLEND);          glEnable(GL_BLEND);
93          glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);          glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
94    
95          glBindTexture(GL_TEXTURE_1D, textureId);          glBindTexture(GL_TEXTURE_2D, textureId);
96    
97          glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);          glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
98    
# Line 120  namespace Lines { Line 123  namespace Lines {
123          glVertex3f(b.x + l.x, b.y + l.y, b.z);          glVertex3f(b.x + l.x, b.y + l.y, b.z);
124    
125          glEnd();          glEnd();
126          glBindTexture(GL_TEXTURE_1D, 0);          glBindTexture(GL_TEXTURE_2D, 0);
127    
128          glPopAttrib();          glPopAttrib();
129      }      }

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26