1
votes

If I want to draw lines, pure lines with GL_LINES primitive with only two positions.

Should I turn ON the glPolygonMode to GL_LINE too ? Or set the drawing primitive to GL_LINES is enough ?

EDIT: I use modern OpenGL technics

1
If you have just 2 points then I recommend to use the GL_LINES primitive. For any triangle primitive you would need at least 3 vertices (points). - Rabbid76
Yes I know that, I wanted to know If I should change the glPolygonMode() state too. - Sébastien Bémelmans
The polygon mode doesn't affect line and point primitives. It just changes the rasterization of polygons (triangles) - see glPolygonMode - Rabbid76
Ok thank you ! I got some troubles to have my lines on screen, I can discard this. - Sébastien Bémelmans

1 Answers

1
votes

It is useless and superfluous to change the polygon mode, when rendering line primitives. As the name suggests, polygon mode only affects polygons (triangle primitives), but it doesn't affect line and point primitives. glPolygonMode just controls the rasterization of polygons (triangles).