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; |
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 |
|
|
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 |
|
|
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 |
} |
} |