OpenGL Geometry

OpenGL includes functions to draw sets of points, lines, and polygons.
All other shapes are made up of these elements.

The basic method for drawing a shape is:

glBegin(...)

glVertex(...)
glVertex(...)
glVertex(...)
...

glEnd()

Always be sure to have a matching glEnd() for each glBegin()



Other calls can be made along with the glVertex calls, such as setting the color.
The state defined by these calls will be associated with the next vertex that is drawn.

However, not all GL function calls can occur between glBegin & glEnd. The allowable functions are listed on pp. 47-48 of the textbook.

GL_POINTS
GL_LINES
GL_LINE_STRIP
GL_LINE_LOOP
GL_TRIANGLES
GL_TRIANGLE_STRIP
GL_TRIANGLE_FAN
GL_QUADS
GL_QUAD_STRIP
GL_POLYGON