glLineWidth - doesn't work !

Help! I’ve been trying to sort out this problem for ages, and I am not getting anywhere!

It seems that
glLineWidth(5.0f);
does not have any effect on lines, and they remain just one pixel thick (even if I try a whole range of numbers).

glPointSize(5.0f) works perfectly, and enabling GL_LINE_SMOOTH doesn’t seem to make any difference other than slightly thicker lines.

Can anyone help?

Works for me onserveral Unix and Windows platforms.

Perhaps if you post a little more info such as OS,graphics, a little code we may be able to help more

the only width which is guaranteed is 1.0
support for other is implemantation depedent

Maybe your implementation does not support thick lines. Try the following piece of code to see how thick lines you can use.

float lineWidth[2];
glGetFloatv(GL_LINE_WIDTH_RANGE, lineWidth);

lineWidth[0] is the minimum width, and lineWidth[1] is the maximum.

I’m using opengl on a mac, with a voodoo 2 card. The actual procedures are like so:

GLvoid DrawBuilding(int by, int bx)
{
glPushMatrix();
glTranslatef(bx * griddist,by * griddist,0.0f);
glEnable(GL_LINE_SMOOTH);
glLineWidth(160000/(px*px));
{where px is your distance away, a value ranging from anything up to a distance of 600}

glBegin(GL_LINES);
glVertex3f( 0.0f, 0.0f, 0.0f);
glVertex3f( 0.0f, 0.0f, 500.0f);
glEnd();
glPopMatrix();
}

This is then used to draw a large grid of vertical lines, disappearing into the distance. It works perfectly, except the line widths do not change. Replacing GL_LINES with GL_POINTS and glLineWidth with glPointSize gives a series of points which get bigger when you get closer, and I was hoping to do this also with lines.

You’ll get errors and even more errors with V2, 3dfx drivers suck.

-Lev

How do I change the minimum and maximum linewidths? I tried out the previous procedure and recieved 0.0 for min and 10.0 for max… is it a fault with the driver? (I know that on some ati drivers, points come out as squares even with GL_POINT_SMOOTH enabled, is this a similar case?) I appreciate your comments

Even staying within the range of 0.0 and 10.0, I’m getting just single thickness lines (using glLineWidth(8.0f) for example). There aren’t any other variables to enable beforehand ?

“How do I change the minimum and maximum linewidths?”

You can’t change this values the Proc
glGetFloatv(GL_LINE_WIDTH_RANGE, lineWidth);
say you what your OpenGL implementatin suport.

O I have forgotten, there is a way to change the values by a other Graphic Card g

Sorry , I suppose I meant it the other way round (getting the values first and then asking the question) .

why dont ya just draw some rects?

and to make it look nice create a texture that looks like a line or something.

-btw it works fine on my 3dfx card (voodoo3)