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

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







>> Use MITSHM: Basically an area of memory is mapped into your process and X11s.
>> Only works if X11 and the process are on the same machine.
>Never heard of it. Got a reference I can look up?

Do a google search on "mitshm" should get you some refs: there also ought to be
manual pages, but I can't for the life of me remember the function names and I
don't have the code on my lappy. It is rather undocumented. The gotcha is that
whenever you do a MITSHM memory swap, you get an X event to tell you it
completed. Even if you've got that event masked out, it still gets sent. So you
need to ensure you retreive it or your event queue will back up. Oh, and the
event ID is undocumented. ISTR it's 0x42, but try getting all the events and see
which ones are unexpected ones.

> Colour allocation is for 8bit displays: you want to find out what the current

>....but how do you get your color then under a say, 24bit display? You'd still
need
>to use XAllocColor right?

No - point is it's a true colour display.. you, ah.. I can't remember how you
get a pixel value to put into the GC. You don't need to do it to use images, you
can juist write the RGB values into the image map.

>> The other, and probably better alternative, is to go look at some of the
>> libraries that will remove some of this aggro - writing an RTS is a big job
>> anyway..

>*nods thoughtfully* I thought 'bout that before, but the problem is, any shared
lib
>I use is _another_ thing to download when compiling the game. It really annoys
me
>that before I build one of these games I have to goto and redownload an extra
40
>Meg of junk each time, which'll be obsolete by the time I need it next time.
I'd
>prefer to avoid it.

There are some stabler ones.. The other thing to do is to design a nice
abstraction layer. Put something on the bottom end of that and put your game
above it. Changes in the library will be handled by the interface layer. Long
ago I did the same thing so the same game code would run under SVGALIB or X11
depending on the link stage.