Page 1 of 1

OpenGl 3D Line Style

Posted: Fri Mar 06, 2020 8:54 am
by IdeasVacuum
It should be possible to define lines with a simple pattern using glLineStipple()

Dashed = 255 (0x00FF) ;Dash-dot-dash = 7239 (0x1C47) ;Dotted = 257 (0x0101)

Code: Select all

  glLineWidth_(2)
    glColor3f_(1.0, 0.2000, 0.2549)
     glEnable_(#GL_LINE_STIPPLE)
glLineStipple_(2, 255)
   glVertex3d_(5.5, 5.0, 0.0)
   glVertex3d_(200.0, 5.0, 0.0)
    glDisable_(#GL_LINE_STIPPLE)
        glEnd_()
The above example draws the line, but no line style.

Re: OpenGl 3D Line Style

Posted: Fri Mar 06, 2020 9:24 am
by alter Mann
GL_INVALID_OPERATION is generated if glLineStipple is executed between the execution of glBegin and the corresponding execution of glEnd.

Re: OpenGl 3D Line Style

Posted: Fri Mar 06, 2020 11:32 am
by IdeasVacuum
...... Well that could have something to do with it :mrgreen:

Thanks alter Mann