[SDL] wxWindows

Daniel Phillips phillips at arcor.de
Fri Jan 24 19:44:01 PST 2003


On Saturday 25 January 2003 02:40, you wrote:
> On Saturday 25 January 2003 00.22, Gib Bogle wrote:
> > If my question is a bit vague, it's because I don't have
> > a good grasp of how SDL and wxWindows would interoperate, or of GUI
> > coding in general (among other things).
>
> I think you would have to use the window ID hack for this. That is,
> instead of SDL setting up it's own window, you pass it one by ID
> through an environment variable named SDL_WINDOWID. Whether or not
> this works with OpenGL is another matter; I frankly have no idea.

X11_GL_GetVisual notices SDL_windowid and uses it, just as X11_CreateWindow 
does, so the problem reduces to letting SDL know about a window that some 
window manager already created, as Sam does in his gtk-demo:

	char SDL_windowhack[32];
		sprintf(SDL_windowhack,"SDL_WINDOWID=%ld",
			GDK_WINDOW_XWINDOW(mainwin->window));
		putenv(SDL_windowhack);

Sam calls this a hack, and that's accurate.

I thought I'd be lazy and just modify Sam's demo to initialize and render 
with OpenGL, but it doesn't work that way.  You have to teach GTK (in this 
case) about OpenGL and I haven't discovered the one true way to do that.  
Here's one possibility:

   http://gtkglext.sourceforge.net/

Regards,

Daniel




More information about the SDL mailing list