mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-23 22:52:34 +01:00
changed format of RImage, added x86 speicfic optimized code
This commit is contained in:
10
wrlib/view.c
10
wrlib/view.c
@@ -20,12 +20,12 @@ int main(int argc, char **argv)
|
||||
puts("cant open display");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
attr.flags = RC_RenderMode | RC_ColorsPerChannel;
|
||||
attr.render_mode = RDitheredRendering;
|
||||
attr.colors_per_channel = 4;
|
||||
ctx = RCreateContext(dpy, DefaultScreen(dpy), &attr);
|
||||
|
||||
|
||||
|
||||
if (argc<2)
|
||||
img = RGetImageFromXPMData(ctx, image_name);
|
||||
else
|
||||
@@ -53,16 +53,18 @@ int main(int argc, char **argv)
|
||||
puts(RMessageForError(RErrorCode));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
printf("%ix%i\n", img->width, img->height);
|
||||
|
||||
|
||||
|
||||
win = XCreateSimpleWindow(dpy, DefaultRootWindow(dpy), 10, 10,
|
||||
img->width,
|
||||
img->height, 0, 0, 0);
|
||||
RDestroyImage(img);
|
||||
XSetWindowBackgroundPixmap(dpy, win, pix);
|
||||
XClearWindow(dpy, win);
|
||||
XMapRaised(dpy, win);
|
||||
XFlush(dpy);
|
||||
|
||||
getchar();
|
||||
exit(0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user