SDL and X and Motif

I wanted to use SDL and X and Motif to write an ‘mngplayer’ which
shall write the animation into the widget window:

static mng_bool user_process_header(mng_handle user_handle,
mng_uint32 width, mng_uint32 height)
{

...
canvas = XtVaCreateManagedWidget("canvas",
  xmDrawingAreaWidgetClass, frame, ...);
...
sprintf(buf, "SDL_WINDOWID=%lu", XtWindow(canvas));
putenv(buf);
fprintf(stderr,
  "\ngetenv(SDL_WINDOWID) --> %s\n", getenv("SDL_WINDOWID"));

SDL_Init(SDL_INIT_VIDEO);

...

}

But ‘stderr’ shows:

getenv(SDL_WINDOWID) --> 23068692

SDL_x11video.c:672:X11_CreateWindow given SDL_Window 23068692
X Error of failed request: BadWindow (invalid Window parameter)
Major opcode of failed request: 3 (X_GetWindowAttributes)
Resource id in failed request: 0x1600014
Serial number of failed request: 39
Current serial number in output stream: 40

Do you know what is wrong?

winfried–

But ‘stderr’ shows:

getenv(SDL_WINDOWID) --> 23068692

SDL_x11video.c:672:X11_CreateWindow given SDL_Window 23068692
X Error of failed request: BadWindow (invalid Window parameter)
Major opcode of failed request: 3 (X_GetWindowAttributes)
Resource id in failed request: 0x1600014
Serial number of failed request: 39
Current serial number in output stream: 40

Do you know what is wrong?

Can you actually find that window in the X client window list?

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

I will look for that. But it should be.

I use two programs like this (swfplayer I had to adapt):

Window my_win = XtWindow(my_widget);

  1. gifview -w my_win my_file

  2. swfplayer -wmy_win -fmy_file

Both programs play into ‘my_win’.

winfried

=> > Do you know what is wrong?
=>
=> Can you actually find that window in the X client window list?
=>
=> See ya,
=> -Sam Lantinga, Software Engineer, Blizzard Entertainment
=>–