public
Created

create 32 bit pixmap test

  • Download Gist
createpixmap.c
C
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
#include <X11/Xlib.h>
#include <X11/Xutil.h>
 
#include <stdio.h>
 
int ApplicationErrorHandler(Display *display, XErrorEvent *theEvent)
{
(void) fprintf(stderr,
"Ignoring Xlib error: error code %d request code %d\n",
theEvent->error_code,
theEvent->request_code) ;
return 0 ;
}
 
int main(int argc, char **argv)
{
Display *dpy;
dpy = XOpenDisplay(NULL);
XSetErrorHandler(ApplicationErrorHandler);
Pixmap p;
p = XCreatePixmap(dpy, XDefaultRootWindow(dpy), 100, 100, 32);
XSync(dpy, True);
printf("%i", (int)p);
return 0;
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.