[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Xlib problems (Lol. I've only been programming in it for 10 days...)



Greetings!

Currently I'm working on an RTS engine, writing the GUI code; in Xlib.
It's all working fine, etc. and now I'm stuck with a problem none of the
books I have seem to address. How do I draw a coloured image to the
screen?

The only way of doing it I've come across so far has been, basically;
make an XImage, and use XPutPixel to put the pixel values in, one at a
time, then XPutImage to draw to the window (or pixmap in my case). Can
anyone help / point me to a tutorial for this stuff? I can't find a
thing.
(Nb. Color allocation stuff in Np. I have at least 3 books on X with
colors. But they only seem to cover allocating colors, or using planes,
which'd be stupid for a picture with >500 different colors.)

In case you're interested, what I'm doing is maintaining a window size
pixel map, I draw into for every thing, which gets a region clip mask to
the GC to make updates quicker. Updates are done by XFlush approx 30
times / second, or for any window expose / whatever events. Ideally. ;)

....And since I'm asking how do I make pieces of my main window
transparent (ie. you can see the desktop behind it in the window).

Thanks!
Shadow Mint.