Functions to draw polygons into a graphics context.
Code example:
void gpath_destroy | ( | GPath * | gpath) |
Free a dynamically allocated gpath created with gpath_create()
void gpath_draw_filled | ( | GContext * | ctx, |
GPath * | path | ||
) |
Draws the fill of a path into a graphics context, using the current fill color, relative to the drawing area as set up by the layering system.
ctx | The graphics context to draw into |
path | The path to fill |
void gpath_draw_outline | ( | GContext * | ctx, |
GPath * | path | ||
) |
Draws the outline of a path into a graphics context, using the current stroke color, relative to the drawing area as set up by the layering system.
ctx | The graphics context to draw into |
path | The path to fill |
Sets the absolute offset of the path. The current translation will be replaced by the specified offset.
path | The path onto which to set the translation |
point | The point which is used as the vector for the translation. |
void gpath_rotate_to | ( | GPath * | path, |
int32_t | angle | ||
) |
Sets the absolute rotation of the path. The current rotation will be replaced by the specified angle.
path | The path onto which to set the rotation |
angle | The absolute angle of the rotation. The angle is represented in the same way that is used with sin_lookup(). See TRIG_MAX_ANGLE for more information. |
struct GPath |
Data structure describing a path, plus its rotation and translation.
Data Fields | ||
---|---|---|
uint32_t | num_points |
The number of points in the points array. |
GPoint | offset | The translation that will to be used when drawing the path with gpath_draw_filled() or gpath_draw_outline() |
GPoint * | points | Pointer to an array of points. |
int32_t | rotation | The rotation that will be used when drawing the path with gpath_draw_filled() or gpath_draw_outline() |
struct GPathInfo |
Data structure describing a naked path.
Data Fields | ||
---|---|---|
uint32_t | num_points |
The number of points in the points array. |
GPoint * | points | Pointer to an array of points. |