Tuesday, June 2, 2009

OpenGL: glLineWidth

//set line width
glLineWidth(20.0f);

glBegin(GL_LINES);

//draw vertices
glVertex3f (-10f, -10.0f, -10.0f);
glVertex3f (10f, 10.0f, 10.0f);

....

glEnd();


Note that not all hardware supports a line width of 20. To find out the supported range and line width increments call:

float sizes, increment;

glGetFloatv(GL_LINE_WIDTH_RANGE, sizes)
glGetFloatv(GL_LINE_WIDTH_GRANULARITY, &increment)

No comments: