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–