/[gzz]/gzz/gfx/liblines/Lines.cxx
ViewVC logotype

Diff of /gzz/gfx/liblines/Lines.cxx

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

revision 1.6 by mudyc, Sat Nov 2 14:22:21 2002 UTC revision 1.7 by mudyc, Sat Nov 2 14:47:57 2002 UTC
# Line 42  namespace Lines { Line 42  namespace Lines {
42              if (level != 0) size /= 2;              if (level != 0) size /= 2;
43    
44              for (int i=0; i<size; i++) {              for (int i=0; i<size; i++) {
45                  line_image[level][i] = 0;                  line_image[level][i] = 0.0;
46              }              }
47    
48              int steps = size / 8;              int steps = size / 8;
# Line 55  namespace Lines { Line 55  namespace Lines {
55    
56              glBindTexture(GL_TEXTURE_1D, texName[level]);              glBindTexture(GL_TEXTURE_1D, texName[level]);
57    
58                glTexParameterf(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER,
59                                GL_LINEAR);
60                glTexParameterf(GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER,
61                                GL_LINEAR_MIPMAP_LINEAR);
62    
63              glTexImage1D(GL_TEXTURE_1D, 0, GL_ALPHA, size,              glTexImage1D(GL_TEXTURE_1D, 0, GL_ALPHA, size,
64                           0, GL_ALPHA, GL_FLOAT, line_image[level]);                           0, GL_ALPHA, GL_FLOAT, line_image[level]);
65    
66                glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_BLEND);
67          }          }
68          has_not_inited = false;          has_not_inited = false;
69      }      }
# Line 74  namespace Lines { Line 81  namespace Lines {
81    
82          if (has_not_inited) init();          if (has_not_inited) init();
83    
84          glLineWidth(linewidth);          //glLineWidth(linewidth);
85            glLineWidth(1);
86    
87          glPushAttrib(GL_ENABLE_BIT);          glPushAttrib(GL_ENABLE_BIT);
88          glEnable(GL_BLEND);          glEnable(GL_BLEND);
89          glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);          glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
90    
91            glBindTexture(GL_TEXTURE_1D, texName[0]);            glBindTexture(GL_TEXTURE_1D, texName[0]);
92    
93            glBegin(GL_QUADS);            glBegin(GL_QUADS);
94                        
95              glTexCoord2f(0,0);              glTexCoord2f(1,0);
96              glVertex3f(a.x, a.y, 0);              glVertex3f(a.x, a.y, 0);
97    
98              glTexCoord2f(0,1);              glTexCoord2f(1,1);
99              glVertex3f(a.x+linewidth, a.y+linewidth, 0);              glVertex3f(a.x+linewidth, a.y+linewidth, 0);
100    
101              glTexCoord2f(1,1);              glTexCoord2f(0,1);
102              glVertex3f(b.x+linewidth, b.y+linewidth, 0);              glVertex3f(b.x+linewidth, b.y+linewidth, 0);
103    
104              glTexCoord2f(1,0);              glTexCoord2f(0,0);
105              glVertex3f(b.x, b.y, 0);              glVertex3f(b.x, b.y, 0);
106    
107            glEnd();            glEnd();

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

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