Embed SDL in a GUI Window

Hi

Maybe it’s just me having strange ideas! I saw in some OpenGL examples that
the OpenGL-“Window” was embeded in a GUI like MFC, WXWindows or whatever.
Just in case it’s not clear what I mean with embed I made a nice ascii
picture :slight_smile: ::-------------------------
? MySDLAPP - = X ?

? File Edit View Help ?

? Static Text: ?
? ---------------- ?
? ? ? ?
? ?OpenGL/SDL/DX ? ?
? ?Canvas ? ?
? ---------------- ?

? NUM Caps ?11?2? ?

Is this possible with SDL? If not why is it working with OpenGL/DX?

Best,
Hans

Fuchs Hans wrote:

Maybe it’s just me having strange ideas! I saw in some OpenGL examples that
the OpenGL-“Window” was embeded in a GUI like MFC, WXWindows or whatever.

I’m planning on doing something like this in the (hopefully near)
future. I;m going to make a wxWindows control that allows you to embed
a libksd application. This is sort of indirectly the same thing but not
really. I’ll get back to work now …

-- David Snopek

/-- libksd –
| The C++ Cross-Platform Game Framework
| Only want to write it once??
| http://libksd.sourceforge.net
------------

Hi

Maybe it’s just me having strange ideas! I saw in some OpenGL examples
that
the OpenGL-“Window” was embeded in a GUI like MFC, WXWindows or whatever.
Just in case it’s not clear what I mean with embed I made a nice ascii
picture :slight_smile: ::

… (cutted)

You can embed SDL as a widget, unfortunaly that only works
in GTK+ in *nix, using an hack.

You have to add a variable to the environment with the X id
of your window so that SDL know how to initialize itself.

There is an example with this, please look at
http://www.libsdl.org/projects/gtk-demo/index.html

Like you I really would like to see this working in other
environments.


Paulo Pinto, uRD Software Engineer
Altitude Software (formerly Easyphone)

paulo.pinto at altitudesoftware.com
www.altitudesoftware.com

The opinions expressed by myself are personal and not of my employer.
Programming languages teach you not to want what they cannot provide.

----- Original Message -----
From: hans.fuchs@ch.telegyr.com (Fuchs Hans)
To:
Sent: Tuesday, April 03, 2001 12:33 PM
Subject: [SDL] Embed SDL in a GUI Window

Hi David

I’m planning on doing something like this in the (hopefully near)
future. I;m going to make a wxWindows control that allows
you to embed
a libksd application. This is sort of indirectly the same
thing but not
really. I’ll get back to work now …

What technique are you going to use? Will this work on GTK only? You somehow
have to pass the handle of the “canvas” to libsdl and patch libsdl that is
uses this handle, haven’t you?

I don’t see why this should only work with GTK ->
http://www.libsdl.org/projects/gtk-demo/index.html

Wouldn’t it be possible adding a function to libsdl where you can pass a
handle that libsdl should use?

GDK_WINDOW_XWINDOW(mainwin->window)); <- passing something like this?

That far I never did GUI-programming for *nix, but I don’t think its too
different from MFC or WINAPI methods. Maybe I am able to help?

Best,
Hans

Fuchs Hans wrote:

Hi David

I’m planning on doing something like this in the (hopefully near)
future. I;m going to make a wxWindows control that allows
you to embed
a libksd application. This is sort of indirectly the same
thing but not
really. I’ll get back to work now …

What technique are you going to use? Will this work on GTK only? You somehow
have to pass the handle of the “canvas” to libsdl and patch libsdl that is
uses this handle, haven’t you?

Well, I am going to use a very old technique passed down through the
ages called cheating! :slight_smile: My solution really doesn’t involve sdl at all,
I going to make libksd applications embedable in wxWindows
applications. Its really just changing the libksd backend from sdl to
wx. Sorry for the confusing and entirely un-related posts …

-- David Snopek

/-- libksd –
| The C++ Cross-Platform Game Framework
| Only want to write it once??
| http://libksd.sourceforge.net
------------