Cocos2d-x encapsulates some OpenGL methods for drawing basic graphics, and test has corresponding examples
1. Draw points. The vertices in this engine are square points. The parameters are coordinate points or coordinate arrays.
2. draw a straight line. The parameter is the start point and the end point. You can set the line width and brush.
3. Circle. The parameter is the center of the circle, the radius, the angle, and the number of segments (the circle is a straight line)
4. Draw a polygon. The parameter is the Dot Array, the number of vertices, and whether the image is closed.
5. Draw a beiser curve. The first example is a control point. The second example is two control points. The last parameter is the number of segments.
Finally, remember to restore the OpenGL value Because OpenGL is a state machine.
I just started to study this engine. If there are any errors, I hope you can correct them more.