{ XYPixmap ZPixmap XShmGetEventBase :: event code. XShmGetImage XShmPixmapFormat(display) == ZPixmap XShmQueryExtension } //XShmQueryVersion(display, @major, @minor, @pixmaps{bool}); { XCreateSimpleWindow(display, RootWindowOfScreen..., InputOutput, visual); != 0 XSizeHints hints hints.flags = PSize or PMinSize or PMaxSize; hints.min_width := hints.max_width := hints.base_width := image_width; hints.min_height... XSetWMNormalHints(display, window, &hints); XStoreName(display, window, "Nice Title"); XSelectInput(display, window, ExposureMask or PKeyPressMask or KeyReleaseMask or ButtonPressMask); XCreateGC(display, window, 0, NULL) // XPutImage. } //XMap{Raised}(display, window); { XCreateImage(display, visual, depth, ZPixmap, offset, data, width, height, bitmap_pad, bytes_per_line) XPutImage(display, drawable, gc, image, src_x, src_y, dest_x, dest_y, width, height) XFreeGC XDestroyWindow XCloseDisplay XShmPutImage(display, drawable, gc, image, src_x, src_y, dest_x, dest_y, width, height, send_completion_event) XFlush } { shmget(IPC_PRIVATE, bytes_per_line * height, IPC_CREAT|0666); < 0 error. addr = shmat(shmid, NULL, 0) == 0 error. readOnly = False. ... XShmDetach XDestroyImage shmdt shmctl(shmid, IPC_RMID, NULL); free seginfo Free GC Destroy Window. Close Display. // or maybe XSetWindowBackgroundPixmap. // event loop: // XNextEvent(display, &ev); // ev.type == KeyPress || ButtonPress. // XNextPevent flush the output buffer? // key codes: XK_Escape, ... }