gzz-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gzz-commits] gzz/gfx/liblines Lines.cxx


From: Matti Katila
Subject: [Gzz-commits] gzz/gfx/liblines Lines.cxx
Date: Sat, 02 Nov 2002 09:22:21 -0500

CVSROOT:        /cvsroot/gzz
Module name:    gzz
Changes by:     Matti Katila <address@hidden>   02/11/02 09:22:21

Modified files:
        gfx/liblines   : Lines.cxx 

Log message:
        Needs some antialiasing.

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/liblines/Lines.cxx.diff?tr1=1.5&tr2=1.6&r1=text&r2=text

Patches:
Index: gzz/gfx/liblines/Lines.cxx
diff -u gzz/gfx/liblines/Lines.cxx:1.5 gzz/gfx/liblines/Lines.cxx:1.6
--- gzz/gfx/liblines/Lines.cxx:1.5      Sat Nov  2 08:56:32 2002
+++ gzz/gfx/liblines/Lines.cxx  Sat Nov  2 09:22:21 2002
@@ -68,18 +68,36 @@
 
 
     void Lines::draw(ZPt a, ZPt b) {
-      if (dbg) cout << linewidth;
-      if (dbg) cout <<" x: "<< a.x << ", "<< b.x 
-                   <<" y: "<< a.y << ", "<< b.y <<"\n";
-
-      if (has_not_inited) init();
-
-      glLineWidth(linewidth);
-
-      glBegin(GL_LINES);
-        glVertex3f(a.x, a.y, a.z);
-       glVertex3f(b.x, b.y, b.z);
-      glEnd();
+        if (dbg) cout << linewidth;
+        if (dbg) cout <<" x: "<< a.x << ", "<< b.x 
+                     <<" y: "<< a.y << ", "<< b.y <<"\n";
 
+       if (has_not_inited) init();
+
+       glLineWidth(linewidth);
+
+       glPushAttrib(GL_ENABLE_BIT);
+       glEnable(GL_BLEND);
+       glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ 
+         glBindTexture(GL_TEXTURE_1D, texName[0]);
+
+         glBegin(GL_QUADS);
+         
+           glTexCoord2f(0,0);
+           glVertex3f(a.x, a.y, 0);
+
+           glTexCoord2f(0,1);
+           glVertex3f(a.x+linewidth, a.y+linewidth, 0);
+
+           glTexCoord2f(1,1);
+           glVertex3f(b.x+linewidth, b.y+linewidth, 0);
+
+           glTexCoord2f(1,0);
+           glVertex3f(b.x, b.y, 0);
+
+         glEnd();
+
+       glPopAttrib();
     }
 }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]