Newbie question about X programming - Xwindows
This is a discussion on Newbie question about X programming - Xwindows ; I have recently started to learn about Xlib in order to develop a
simple game (the computers used can't have anything more installed but
Motif) with animated graphic but I am only in the early stage of
developement becouse I ...
-
Newbie question about X programming
I have recently started to learn about Xlib in order to develop a
simple game (the computers used can't have anything more installed but
Motif) with animated graphic but I am only in the early stage of
developement becouse I have difficulties to display properly pictures
on screen.
I suppose according to the documentation I found on Internet that I
can make it using
XpmReadFileToPixmap(display, filename, image, mask, attributes)
XCopyPlane(display, src, dest, gc, src_x, src_y, width, height,
dest_x, dest_y, plane)
XSetClipMask(display, gc, pixmap)
XCopyArea(display, src, dest, gc, src_x, src_y, width, height,
dest_x, dest_y)
But I have some problems while understanding how to use planes in
order to show the bitmap of the mask (for testing purposes).
When I tried to convert using XpmReadFileToPixmap() (from libXpm.a),
XCreatePixmap() and XPutImage(), but I got a BadMatch error, and I
didn't understand why (I suppose there was a misconfiguration of depth
somewhere...)
Furthermore I am wondering if there is not a more efficient way to use
pictures with transparency than using the clip_mask of the GC struct
since my only success in this project is displaying the picture but
without plane_mask.
I really would be pleased if someone can help me finding Web
documentation, of if not possible, to explain me with a brief tutorial
an example of usage of these function (or maybe a other method more
efficient) to display pictures with transparency obtained from a xpm
file.
Thanks you very much in advance for your help and your interest
Yvan BARTHELEMY
Student at IUT d'Orsay (FRANCE)
-
Re: Newbie question about X programming
ybarthelemy@free.fr (Yvan Barth?lemy) wrote in
news:f5016dea.0404121043.2723888a@posting.google.c om:
> When I tried to convert using XpmReadFileToPixmap() (from libXpm.a),
> XCreatePixmap() and XPutImage(), but I got a BadMatch error, and I
> didn't understand why (I suppose there was a misconfiguration of depth
> somewhere...)
My web site has pointers to some tutorials on XPM, bit planes, and debugging BadMatch
errors.
Ken Lee, http://www.rahul.net/kenton/