TkGS defines a set of drawing primitives that can be invoked on any drawable, thus providing device independence. These primitives use the current drawing state held by the TkGS_Drawable on which they are invoked, in a state-based manner (like on Windows and contrary to X-Window where one must pass a valid GC to each drawing primitive).
void TkGS_DrawPixel(
TkGS_Drawable drawable,
int x,
int y
);
drawable: the TkGS_Drawable on which to
draw the primitive.
x, y: x and y coordinates of pixel.
drawable.
void TkGS_DrawArc(
TkGS_Drawable drawable,
int filled,
int x,
int y,
int width,
int height,
int start,
int extent
);
drawable: the TkGS_Drawable on which to
draw the primitive.
filled: whether the primitive should be filled or not.
x, y: x and y coordinates of top-left
corner of bounding box.
width, height: width and height of
bounding box.
start, extent: starting angle and extent
in trigonometric (counter-clockwise) order, in 1/64th degrees.
drawable.
void TkGS_DrawLine(
TkGS_Drawable drawable,
int x1,
int y1,
int x2,
int y2
);
drawable: the TkGS_Drawable on which to
draw the primitive.
x1, y1: x and y coordinates of start
point.
x2, y2: x and y coordinates of end point.
drawable.
void TkGS_DrawEllipse(
TkGS_Drawable drawable,
int filled,
int x,
int y,
unsigned int width,
unsigned int height
);
drawable: the TkGS_Drawable on which to
draw the primitive.
filled: whether the primitive should be filled or not.
x, y: x and y coordinates of top-left
corner of bounding box.
width, height: width and height of bounding box.
drawable.
void TkGS_DrawPolygon(
TkGS_Drawable drawable,
int filled,
TkGS_Point* points,
int nbPoints
);
drawable: the TkGS_Drawable on which to
draw the primitive.
filled: whether the primitive should be filled or not.
points: array of TkGS_Points defining the polygon
vertices.
nbPoints: number of points in the above array.
drawable.
void TkGS_DrawPolyline(
TkGS_Drawable drawable,
TkGS_Point* points
int nbPoints
);
drawable: the TkGS_Drawable on which to
draw the primitive.
points: array of TkGS_Points defining the
polyline vertices.
nbPoints: number of points in the above array.
drawable.
void TkGS_DrawRectangle(
TkGS_Drawable drawable,
int filled,
int x,
int y,
unsigned int width,
unsigned int height
);
drawable: the TkGS_Drawable on which to
draw the primitive.
filled: whether the primitive should be filled or not.
x, y: x and y coordinates of top-left
corner of bounding box.
width, height: width and height of bounding box.
drawable.
void TkGS_DrawRoundedRectangle(
TkGS_Drawable drawable,
int filled,
int x,
int y,
unsigned int width,
unsigned int height,
int rx,
int ry
);
drawable: the TkGS_Drawable on which to
draw the primitive.
filled: whether the primitive should be filled or not.
x, y: x and y coordinates of top-left
corner of bounding box.
width, height: width and height of bounding box.
rx, ry: x and y radii of the ellipse used
to draw the rounded corners.
drawable.