Вот что появляется в X11/Xlib.h, установленном совсем недавно:
Код: Выделить всё
extern int XDrawRectangle(
Display* /* display */,
Drawable /* d */,
GC /* gc */,
int /* x */,
int /* y */,
unsigned int /* width */,
unsigned int /* height */
);
Код: Выделить всё
/* Draw a rectangle at (x,y) with width (w) and height (h) */
void gfx_rect( int x, int y, unsigned int w, unsigned int h );
Код: Выделить всё
/* Draw a rectangle at (x,y) with width (w) and height (h) */
void gfx_rect( int x, int y, unsigned int w, unsigned int h ) {
XDrawRectangle(gfx_display,gfx_window,gfx_gc,x,y,w,h);
}
Код: Выделить всё
const int offset = 10;
int x = 0;
int y = 0;
gfx_rect(x+offset, y+offset, 20, 20);

Обратите внимание, что нижний правый пиксель отсутствует.
Подробнее здесь: https://stackoverflow.com/questions/792 ... ight-pixel