Porting Lines

Porting IRIS GL code that draws lines is fairly straightforward, though you should note the differences in the way OpenGL stipples. The following table lists IRIS GL functions for drawing lines and their equivalent OpenGL functions.

IRIS GL Function OpenGL Function Meaning
bgnclosedline,

endclosedline

glBegin(GL_LINE_LOOP)

glEnd

Draw a closed line.
bgnline glBegin(GL_LINE_STRIP) Draw line segments.
linewidth glLineWidth Set line width.
getlwidth glGet(GL_LINE_WIDTH) Return current line width.
deflinestyle,

setlinestyle

glLineStipple Specify a line stipple pattern.
lsrepeat factor argument of glLineStipple Set a repeat factor for the line style.
getlstyle glGet(GL_LINE_STIPPLE_PATTERN) Return line stipple pattern.
getlsrepeat glGet(GL_LINE_STIPPLE_REPEAT) Return repeat factor.
linesmooth, smoothline glEnable(GL_LINE_SMOOTH) Turn on line antialiasing (For more information on antialiasing, see Porting Antialiasing Functions.)

OpenGL doesn't use tables for line stipples; it maintains only one line-stipple pattern. You can use glPushAttrib and glPopAttrib to switch between different stipple patterns.

Older IRIS GL line style functions (such as draw, lsbackup, getlsbackup, and so on) are not supported by OpenGL.

For information on drawing antialiased lines, see Porting Antialiasing Functions.