Am trying to use SDL on our embedded Mips board and am running into some
basic problems. One problem is that I’m new to the X Windows world ;), but
come from years of Quicktime programming so the concepts are not totally
foreign.
The non-display test programs seem to work fine.
When I run any of the display programs I crash the X server. The error comes
when SetVideoMode calls down to into X11_SetupImage. The code sequence is
below, but basically it never comes back from XSync.
Three questions:
- We run TinyX, is there any problem with running SDL ontop of TinyX?
- Where do I find the documentation on the XShm calls? They’re not in the
Xlib Programming/Reference Manuals. - What does the NO_SHARED_MEMORY mean? If this is defined, then the XShmXX
calls aren’t made and the ones from Xlib are. Not sure how this define would
be set from the configure.
Thanks for any help.
casey-----
int X11_SetupImage(_THIS, SDL_Surface screen)
{
#ifdef NO_SHARED_MEMORY
screen->pixels = malloc(screen->hscreen->pitch);
#else
/* Allocate shared memory if possible /
if ( use_mitshm ) {
shminfo.shmid = shmget(IPC_PRIVATE, screen->hscreen->pitch,
IPC_CREAT|0777);
if ( shminfo.shmid >= 0 ) {
shminfo.shmaddr = (char *)shmat(shminfo.shmid, 0, 0);
shminfo.readOnly = False;
if ( shminfo.shmaddr != (char *)-1 ) {
shm_error = False;
X_handler = XSetErrorHandler(shm_errhandler);
XShmAttach(SDL_Display, &shminfo);
XSync(SDL_Display, True);
*** this is where the crash happens ****