Input Data

The OpenGL pipeline requires you to input several types of data:

  • Vertices. Vertices describe the shape of the desired geometric object. To specify vertices, use glVertex* functions in conjunction with glBegin and glEnd to create a point, line, or polygon. You can also use glRect to describe an entire rectangle at one time.
  • Edge flag. By default, all edges of polygons are boundary edges. Use glEdgeFlag* to explicitly set the edge flag.
  • Current raster position. Specified with glRasterPos*, the current raster position is used to determine raster coordinates for pixel- and bitmap-drawing operations.
  • Current normal. A normal vector associated with a particular vertex determines how a surface at that vertex is oriented in three-dimensional space; this in turn affects how much light that particular vertex receives. Use glNormal* to specify a normal vector.
  • Current color. The color of a vertex, together with the lighting conditions, determine the final, lit color. Color is specified with glColor* if in RGBA mode, or with glIndex* if in color-index mode.
  • Current texture coordinates. Specified with glTexCoord*, texture coordinates determine the location in a texture map to associate with a vertex of an object.

Note

When glVertex* is called, the resulting vertex inherits the current edge flag, normal, color, and texture coordinates. Therefore, glEdgeFlag*, glNormal*, glColor*, and glTexCoord* must be called before glVertex*, if they are to affect the resulting vertex.