Xshm -- help requested (and some help w/ XGrabPointer)

Xshm -- help requested (and some help w/ XGrabPointer)

Post by djenkin » Sun, 21 Sep 1997 04:00:00



Hello.
        Does anyone have a very simple code snippet that will use xshm to
copy a pixmap to the display?  I'm looking for a single function (or
enough code to write a single function) that completey encapsulates teh
mitshm stuff.  I am not worried about the in-effecientcies of a singel
function allocating shm, using it, and destroying it (ultimately, I'll
pull of the shmattach and shmdetach for speed/optimization reasons.)

        I cannot seem to find ANY online docs (either on my linux box,
and ANY of teh Sun Ultras on campus, on any web site) for using mitshm w/
X.  I have a single code snippet from someone else, but there code won't
work.  XShmAttach (or whatever it is called) keeps dying.  My program
aborts w/ some kind of 'BadValue' error.

        All I know about Xshm is from looking at
/usr/include/X11/extensions/XShm.h and running
'nm /usr/X11/lib/Xext.so.something'...

        Reason:  I'm writing a real-time game.  The game itself works
well, except display speed is a little slow.  I render everything (for
each frame) into a single pixmap by directy pokeing (God, did I really
say 'poke'... basica... ick) numbersinto the pixmap's internal data
buffer. (btw, if I only permit my program to allocate a 'Pseaudo color'
visual, will this be platform independant, or atleaast easily fixed w/ a
few platform ifdefs?  XPutPixel is too slow...)  I want to replace
XPutImage w/ teh shm equivilent for speed.
        Whomever helps me gets their name & email addr in my credits
screen if they want it.  That's all I really have ot offer for assistance.

Thanks in advance...

--


Gamma Lambda 204 of Pi Kappa Phi               http://www.umr.edu/~pikapps
Research & Development, RDS, Inc               http://www.rds-systems.com

                A nuclear war can really ruin your compile.