-
-
Notifications
You must be signed in to change notification settings - Fork 18
Shapes
Vašek edited this page Feb 5, 2019
·
4 revisions
Simplex renders all shapes using so called vertices, which are in a form of an array sent to a gpu with additional information about how to process them. That means all shapes are 3D accelerated, resulting in a great performance when drawing them and an ability to zoom almost indefinitely without loosing quality of images - vertices are simply put vectors often equipped with more parameters, like color or texture. When a task is given to draw a shape, the first step engine does is triangulation - a process that populates a list of triangles (as gpu is able to draw only triangles) which together form desired shape. Lines are essentially made out of one triangle with two out of three points sharing positions. Rectangle / square is shaped from two triangles as shown in the image above. Once triangles are constructed, they are drawn using a process of rasterization. This allows us to draw either filled shapes or just wires. Below is a list of sgml functions one can use to render various shapes.
- draw_arrow
- draw_circle
- draw_circle_color
- draw_circle_fast
- draw_ellipse
- draw_ellipse_color
- draw_line
- draw_line_color
- draw_line_width
- draw_line_width_color
- draw_point
- draw_point_color
- draw_rectangle
- draw_rectangle_color
- draw_roundrect
- draw_roundrect_color
- draw_triangle
- draw_triangle_color
- draw_path
Back to Drawing