X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fx11.c;h=3440210627907698c0c4454d5c74c29bc9421a01;hb=a8b2caa1d373c84c1b3fc2f615370c2a319051ca;hp=5b97d5ec66fb18faccc4a0974ef799c54fa9b5d5;hpb=7d958613de0b14e460ebca1a651b73cfadf9213c;p=rocksndiamonds.git diff --git a/src/x11.c b/src/x11.c index 5b97d5ec..34402106 100644 --- a/src/x11.c +++ b/src/x11.c @@ -12,7 +12,7 @@ * x11.c * ***********************************************************/ -#ifdef USE_X11_LIBRARY +#ifdef TARGET_X11 #include "main.h" #include "misc.h" @@ -69,8 +69,9 @@ static void X11InitDisplay() #endif /* !MSDOS */ } -static void X11InitWindow() +static DrawWindow X11InitWindow() { + Window window; unsigned int border_width = 4; XGCValues gc_values; unsigned long gc_valuemask; @@ -185,17 +186,21 @@ static void X11InitWindow() gc_values.background = pen_bg; gc_valuemask = GCGraphicsExposures | GCForeground | GCBackground; gc = XCreateGC(display, window, gc_valuemask, &gc_values); + + return window; } -inline void X11InitBufferedDisplay(DrawBuffer *unused1, DrawWindow *unused2) +inline void X11InitBufferedDisplay(DrawBuffer *backbuffer, DrawWindow *window) { X11InitDisplay(); - X11InitWindow(); + *window = X11InitWindow(); - XMapWindow(display, window); + XMapWindow(display, *window); FlushDisplay(); - pix[PIX_DB_BACK] = CreateBitmap(WIN_XSIZE, WIN_YSIZE, DEFAULT_DEPTH); + /* create additional buffer for double-buffering */ + *backbuffer = CreateBitmap(WIN_XSIZE, WIN_YSIZE, DEFAULT_DEPTH); + pix[PIX_DB_BACK] = *backbuffer; /* 'backbuffer' is off-screen buffer */ } -#endif /* USE_X11_LIBRARY */ +#endif /* TARGET_X11 */