View Full Version : glLineWidth - doesn't work !

11-15-2001, 03:50 AM
Help! I've been trying to sort out this problem for ages, and I am _not_ getting anywhere!

It seems that
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?

11-15-2001, 04:44 AM
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

11-15-2001, 05:00 AM
the only width which is guaranteed is 1.0
support for other is implemantation depedent

11-15-2001, 05:05 AM
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.

11-15-2001, 05:06 AM
I'm using opengl on a mac, with a voodoo 2 card. The actual procedures are like so:

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

glVertex3f( 0.0f, 0.0f, 0.0f);
glVertex3f( 0.0f, 0.0f, 500.0f);

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.

11-15-2001, 05:12 AM
You'll get errors and even more errors with V2, 3dfx drivers suck.


11-15-2001, 05:21 AM
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

11-15-2001, 05:41 AM
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 ?

11-15-2001, 05:52 AM
"How do I change the minimum and maximum linewidths?" http://www.opengl.org/discussion_boards/ubb/smile.gif

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*

11-15-2001, 06:03 AM
Sorry http://www.opengl.org/discussion_boards/ubb/wink.gif, I suppose I meant it the other way round (getting the values first and then asking the question) http://www.opengl.org/discussion_boards/ubb/smile.gif.

11-16-2001, 02:15 AM
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)