OpenGL functions-glbegin and glend

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.