Once you understand drawables, colors, visuals, graphics
contexts, and fonts, actually drawing is very simple. This
section is a quick summary of the GDK drawing routines.
Remember that drawing is a server-side operation; for
example, if you ask to draw a line, Xlib will send the
line's endpoints to the server, and the server will do the
actual drawing using the specified GC (the GC is also a
server-side resource). Often this is an important
performance consideration.
You can draw a single point with
gdk_draw_point(), or multiple points with gdk_draw_points() (Figure 17). The point is
drawn in the current foreground color. Multiple points
are given as an array. A
GdkPoint looks like this:
typedef struct _GdkPoint GdkPoint;
struct _GdkPoint
{
gint16 x;
gint16 y;
};
|
Remember that X coordinates start in the top left corner,
are relative to the drawable, and may not overflow a
signed sixteen-bit integer.