Jump to content

OpenGL Programming/reference/glBegin

From Wikibooks, open books for an open world

Description

[edit | edit source]
  • Defines a list of points to make in to primitives.
  • The type of primitive is passed when you call it.

Useage Context

[edit | edit source]

Allowed Primitive Types

[edit | edit source]
  • [[OpenGL_Programming/reference/GL_POINTS
    • Each vertex is a single point
  • [[OpenGL_Programming/reference/GL_LINES
    • Must be a multiple of 2
    • Each pair of vertices is a independent line segment.
  • [[OpenGL_Programming/reference/GL_LINE_STRIP
    • Draws a connected group of line segments from the first vertex to the last. After the first Vertices each additonal Vertices draws a new line.
  • [[OpenGL_Programming/reference/GL_LINE_LOOP
    • Draws a connected group of line segments from the first vertex to the last. The last line is defined by the first and last vertex makeing a closed loop.
  • [[OpenGL_Programming/reference/GL_TRIANGLES
    • Each triplet of vertices as an independent triangle.
    • Must be a multiple of 3
  • [[OpenGL_Programming/reference/GL_TRIANGLE_STRIP
    • Draws a connected group of triangles. After the first 2 vertices each additonal point defines a new triangle. The triangle is made up of the last 2 and the newest vertex moving down the list.
  • [[OpenGL_Programming/reference/GL_TRIANGLE_FAN
    • Draws a connected group of triangles. After the first 2 vertices each additonal point defines a new triangle. The triangle is made up of the first the last and the newest vertex moving down the list.
  • [[OpenGL_Programming/reference/GL_QUADS
    • Each group of four vertices as an independent quadriliteral.
    • Must be a multiple of 4
  • [[OpenGL_Programming/reference/GL_QUAD_STRIP
    • Draws a connected group of quadriliterals. After the first 2 Vertices each additonal pair Vertices makes a new quadriliteral.
    • Must be a multiple of 2 after the first 2 Vertices.
  • [[OpenGL_Programming/reference/GL_POLYGON
    • Draws a single polygon. same as GL_LINE_STRIP
    • Must have 3 or more Vertices.

Functions allowed inside a glBegin glEnd section

[edit | edit source]

Useage Examples

[edit | edit source]

functon definitions

[edit | edit source]
[edit | edit source]

References

[edit | edit source]

http://www.cs.utk.edu/~vose/c-stuff/opengl/glBegin.html