wrlib: Fixed and improved NETPBM examples

The tests examples were not compiling because of a missing X11 lib.

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
This commit is contained in:
David Maciejak authored and Carlos R. Mafra committed 2014-04-24 10:56:51 +01:00
1 parent 8b73356c4f
commit de1421394c
3 files changed
+7 -3

No files matched your search

+4 -2
View File
@@ -24,8 +24,10 @@ int main(int argc, char **argv)
attr.colors_per_channel = 4;
ctx = RCreateContext(dpy, DefaultScreen(dpy), &attr);
if (argc < 2)
if (argc < 2) {
printf("using default image as none was provided\n");
img = RGetImageFromXPMData(ctx, image_name);
}
else
img = RLoadImage(ctx, argv[1], 0);
@@ -70,7 +72,7 @@ int main(int argc, char **argv)
exit(1);
}
printf("%ix%i\n", img->width, img->height);
printf("size is %ix%i\n", img->width, img->height);
win = XCreateSimpleWindow(dpy, DefaultRootWindow(dpy), 10, 10, img->width, img->height, 0, 0, 0);
XSetWindowBackgroundPixmap(dpy, win, pix);