[SDL] SDL_WINDOWID: embedding SDL into gtkmm

Mikael Eriksson mikael_miffe_eriksson at yahoo.se
Sat Sep 15 04:19:42 PDT 2007


On Sat, Sep 15, 2007 at 11:04:57AM +0200, Germán Diago wrote:
> 2007/9/15, Mikael Eriksson <mikael_miffe_eriksson at yahoo.se>:
> >
> > On Fri, Sep 14, 2007 at 11:21:28AM +0200, Germán Diago wrote:
> > > Hello. I'm trying to embed an SDL_Window into my own application.
> > > I think that this way SDL should draw into my own application window,
> > like
> > > described in a lot of mailing lists I googled.
> > > But I get an SDL toplevel window instead. So I have my app's window and
> > an
> > > SDL one. I checked if the variable is
> > > correctly set up, and it is. So... could anyone help on this, please.
> > > Thank you very much in advance.
> >
> > I'm not sure but i think the window has to be a GtkSocket, atleast that
> > works for me, see the attached test program. It works but putting the
> > draw rect stuff inside the button callback didn't seem to work, thats
> > why it's an event.
> 
> 
> 
>    I thought of this way of doing that. But the problem is that I have two
> different processes instead of
>   one. I'd like to have one process and two threads to manage the whole
> program. Anyway, if there's not
>   an optimal solution, I'll try with the two processes one. Thanks for your
> help.

You don't have to put them into separate processes, GtkSocket works just
fine with everything in one process. Anyway, doing it like you did in
the first mail, using SDL_WINDOWID=GDK_WINDOW_XWINDOW(window->window)
works for me. But i'm not using gtkmm, can it be that that is
interfering?


More information about the SDL mailing list