OpenGL functions-glbegin and glend
Function prototype:
Void glbegin(GlenumMode)
Void glend(Void)
Parameter description:
Mode: Type of the created element. It can be the following value
-
- Gl_points: processes each vertex as a vertex. vertex N defines vertex N and draws n vertices in total.
- Gl_lines: Each vertex is used as an independent line segment. n lines are defined between the 2n-1 and 2n vertices, and n/2 lines are drawn in total.
-
- Gl_line_strip: Draw a group of line segments connected from the first vertex to the last vertex. The N and n + 1 vertices define the line segment N, and draw n-1 lines in total.
-
- Gl_line_loop: draws a group of line segments connected from the first vertex to the last vertex, and then connects the last vertex to the first vertex, the N and n + 1 vertices define the line N and draw n lines in total.
-
- Gl_triangles: each vertex is used as an independent triangle. The 3N-2, 3n-1, and 3n vertices define the nth triangle. N/3 triangles are drawn in total.
-
- Gl_triangle_strip: draws a group of connected triangles. N triangles are defined for odd n, vertex N, N + 1, and n + 2. For even n, vertex N + 1, n, and n + 2 define the nth triangle, drawing a total of N-2 triangles
- Gl_triangle_fan: Draw a group of connected triangles, which are determined by the first vertex and the vertex given after it. vertex 1, n + 1, and n + 2 define the nth triangle, draw a total of N-2 triangles
-
- Gl_quads: Draw a group of independent quadrilateral composed of four vertices. Vertex 4n-3, 4n-2, 4n-1, and 4N define the nth quadrilateral. Draw N/4 quadrilateral in total
-
- Gl_quad_strip: Draw a group of connected quadrilateral. Each quadrilateral is determined by a pair of vertices and a pair of vertices given afterwards. Vertex 2n-1, 2n, 2n + 2, and 2n + 1 Define the nth quadrilateral. n/2-1 Quadrilateral is drawn in total.
-
- Gl_polygon: Draw a convex polygon. Vertices 1 to n define this polygon.
Function Description:
The glbegin and glend functions define fixed points for one or more groups of elements.