SDL and GTK in one window

First off, apologies for asking a question that’s probably been asked
before, but I can’t find a good answer anywhere.

Anyway, I’m trying to figure out how to put an SDL window inside a GTK
window. The few clues I’ve found are that GTK has EventBox and draw box
widgets that have their own X window ID, which should be “passed to
SDL”. My question is this: How, exactly, do I get this X Window ID,
and then how do I go about “passing” it to SDL?

Also, I’ve seen stuff about conflicts in event handling (mouse clicks
and stuff like thatbetween SDL and GTK. Is there a way to avoid these
conflicts?

Thanks,
Bart

Here’s a link to a hack ( i think it’s gtk 1.2 only)
http://www.cs.umn.edu/~mein/game/gtk-test.tgz

I tried doing this too and had trouble with it. I would recommend just
using gtk and either gtkglext.sourceforge.net or gtkglarea (dont’
remember url).

/Line72On Fri, 2003-04-25 at 15:26, Bart Kelsey wrote:

First off, apologies for asking a question that’s probably been asked
before, but I can’t find a good answer anywhere.

Anyway, I’m trying to figure out how to put an SDL window inside a GTK
window. The few clues I’ve found are that GTK has EventBox and draw box
widgets that have their own X window ID, which should be “passed to
SDL”. My question is this: How, exactly, do I get this X Window ID,
and then how do I go about “passing” it to SDL?

Also, I’ve seen stuff about conflicts in event handling (mouse clicks
and stuff like thatbetween SDL and GTK. Is there a way to avoid these
conflicts?

Thanks,
Bart


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl
18:58:26 up 20:52, 4 users, load average: 0.33, 0.47, 0.46

Mark D’voo wrote:

Here’s a link to a hack ( i think it’s gtk 1.2 only)
http://www.cs.umn.edu/~mein/game/gtk-test.tgz

I tried doing this too and had trouble with it. I would recommend just
using gtk and either gtkglext.sourceforge.net or gtkglarea (dont’
remember url).

/Line72

I’ve seen this, actually, and I managed to make it compile. It opens up
two separate windows (one GTK, and one SDL), and it’s not what I’m
trying to accomplish. :frowning:

Thanks anyway,
Bart>On Fri, 2003-04-25 at 15:26, Bart Kelsey wrote:

I’ve seen this, actually, and I managed to make it compile. It opens up
two separate windows (one GTK, and one SDL), and it’s not what I’m
trying to accomplish. :frowning:

Give a try to http://www.contrib.andrew.cmu.edu/~tmartin/senken/
This game have SDL window embedded in GTK.

Good luck,
Pawe? R??a?ski

Here’s a link to a hack ( i think it’s gtk 1.2 only)
http://www.cs.umn.edu/~mein/game/gtk-test.tgz

Nope, it works with 2.0 too, without any warnings ;))))
gcc gtk-test.c sdl-config --libs --cflags pkg-config gtk+-2.0 --libs --cflags

Thanks,
Pawe? R??a?ski