XDrawPoint(3)
π XDrawPoint(3) β draw points and the XPoint structure π
okay so this page is from XLIB FUNCTIONS, and it's literally all about XDrawPoint, XDrawPoints, and XPoint. Bestie, if you're drawing points in Xlib, this is your main character page. β¨
πΈ NAME πΈ
XDrawPoint, XDrawPoints, XPoint β draw points and points structure. Periodt. π
π¦ SYNTAX π¦
int XDrawPoint(Display *display, Drawable d, GC gc, int x, int y);
int XDrawPoints(Display *display, Drawable d, GC gc, XPoint *points, int
npoints, int mode);
π ARGUMENTS π
dβ specifies the drawable.displayβ specifies the connection to the X server.gcβ specifies the GC.modeβ specifies the coordinate mode. You can passCoordModeOriginorCoordModePrevious.npointsβ specifies the number of points in the array.pointsβ specifies an array of points.x,yβ specify the x and y coordinates where you want the point drawn.
π DESCRIPTION π
So XDrawPoint is the single-point girlie: it uses the foreground pixel and function components of the GC to draw a single point into the specified drawable. XDrawPoints draws multiple points this way. slay. β¨
CoordModeOrigin treats all coordinates as relative to the origin, and CoordModePrevious treats all coordinates after the first as relative to the previous point. XDrawPoints draws the points in the order listed in the array. iykyk.
Both functions use these GC components: function, plane-mask, foreground, subwindow-mode, clip-x-origin, clip-y-origin, and clip-mask. That's the whole vibe check. π
XDrawPoint can generate BadDrawable, BadGC, and BadMatch errors. XDrawPoints can generate BadDrawable, BadGC, BadMatch, and BadValue errors.
π§ STRUCTURES π§
The XPoint structure contains:
typedef struct {
short x, y;
} XPoint;
All x and y members are signed integers. The width and height members are 16-bit unsigned integers. You should be careful not to generate coordinates and sizes out of the 16-bit ranges, because the protocol only has 16-bit fields for these values. no cap, that's a real warning bestie π
π₯ DIAGNOSTICS π₯
BadDrawableβ a value for aDrawableargument does not name a definedWindoworPixmap.BadGCβ a value for aGContextargument does not name a definedGContext.BadMatchβ anInputOnlywindow is used as aDrawable.BadMatchβ some argument or pair of arguments has the correct type and range but fails to match in some other way required by the request.BadValueβ some numeric value falls outside the range of values accepted by the request. Unless a specific range is specified for an argument, the full range defined by the argument's type is accepted. Any argument defined as a set of alternatives can generate this error.
π SEE ALSO π
XDrawArc(3)XDrawLine(3)XDrawRectangle(3)Xlib - C Language X Interface
π xoxo, footer bestie: X Version 11, libX11 1.8.14, and this page is XDrawPoint(3) β source/version vibes, and no date is printed here, so I'm not inventing one. Periodt. π
π¦ where this page comes from
- alpine 3.24: libx11-doc 1.8.14-r0 Β· X11
- arch rolling: libx11 1.8.14-1 Β· MIT AND X11
- nixos 26.05: libx11 1.8.14
- nixpkgs unstable: libx11 1.8.14
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms