SDL and GTK

I have been working on something that requires SDL to be run in a
GTK Window. I am using the following (from the gtk-demo) to get it to
work:

sprintf(SDL_windowhack,“SDL_WINDOWID=%d”,
GDK_WINDOW_XWINDOW(wnd_main->window));
putenv(SDL_windowhack);

This works with SDL version 1.0.4, but fails with 1.0.8 and 1.1.1. The
error I get is:

Gdk-ERROR **: BadWindow (invalid Window parameter)
serial 33 error_code 3 request_code 2 minor_code 0

System info:
RedHat Linux 6.2
Xfree86 running 1600x1200 @16-bit
Pentium III system
3dfx Voodoo 3000
(e-mail me if you need more info)

Does anyone know what the problem is and how it can be solved? Is there
a better way to interface GTK and SDL? If not, are there any efforts to
patch SDL to work with GTK? It seems that SDL+GTK would be a powerful
combination.

-Erik

This works with SDL version 1.0.4, but fails with 1.0.8 and 1.1.1. The
error I get is:

Gdk-ERROR **: BadWindow (invalid Window parameter)
serial 33 error_code 3 request_code 2 minor_code 0

Try the latest CVS snapshot:
http://www.devolution.com/~slouken/SDL/cvs.html

-Sam Lantinga, Lead Programmer, Loki Entertainment Software

Sam Lantinga wrote:

This works with SDL version 1.0.4, but fails with 1.0.8 and 1.1.1. The
error I get is:

Gdk-ERROR **: BadWindow (invalid Window parameter)
serial 33 error_code 3 request_code 2 minor_code 0

Try the latest CVS snapshot:
http://www.devolution.com/~slouken/SDL/cvs.html

    -Sam Lantinga, Lead Programmer, Loki Entertainment Software

I went ahead and grabbed the source from CVS and followed the directions,
but it still fails. I checked to make sure it installed correctly and
/usr/include/SDL/SDL.h reports the version as 1.1.2. I made sure to run
ldconfig and rebuild gtk-demo. Another note: I am running GTK 1.2.7, should
I grab the latest GTK from CVS?

-Erik

Erik wrote:

Sam Lantinga wrote:

This works with SDL version 1.0.4, but fails with 1.0.8 and 1.1.1. The
error I get is:

Gdk-ERROR **: BadWindow (invalid Window parameter)
serial 33 error_code 3 request_code 2 minor_code 0

Try the latest CVS snapshot:
http://www.devolution.com/~slouken/SDL/cvs.html

    -Sam Lantinga, Lead Programmer, Loki Entertainment Software

I went ahead and grabbed the source from CVS and followed the directions,
but it still fails. I checked to make sure it installed correctly and
/usr/include/SDL/SDL.h reports the version as 1.1.2. I made sure to run
ldconfig and rebuild gtk-demo. Another note: I am running GTK 1.2.7, should
I grab the latest GTK from CVS?

-Erik

By the way, the problem was that the RPM installs the libs under /usr/lib, but
the script stores them under /usr/local/lib. just do ./configure --prefix=/usr
to get around this.

–Erik