[SDL] act as one form
phillips at arcor.de
Tue Jan 21 20:27:00 PST 2003
On Sunday 19 January 2003 19:09, Corona688 wrote:
> Sometimes takes awhile to get a decent response, unforunately. I'll do my
> Blake D wrote:
> > Hello,
> > Is there no way to display your sdl surface on a form that you create
> > with another tool?? :(
> There is no way to do this that is standard, crossplatform, and/or stable.
> SDL is simply not designed to co-exist inside something else's window, it
> makes it's OWN window. That said, there are a variety of GUI libraries for
> SDL you can find on www.libsdl.org/libraries.php to do GUI stuff within
> your SDL window...
Perhaps he didn't ask the right question. I certainly want to be able to
have my OpenGL surface use only part of an SDL window, leaving me free to
draw into the remainder in any way I choose, including with various kinds of
widgets. I'd be surprised if there's any insurmountable obstacle in the way
to doing this cross-platform (please surprise me if there is).
I just checked, and Mesa is quite happy to use less than the full SDL window
for its viewport. However, I notice that the remainder of the window gets
cleared to my glClearColor, which means somebody is blitting a part of the
screen they ought not to, which would definitely screw up this idea. It
looks like Mesa is the culprit, but I haven't done much digging yet. It seems
fundamentally broken for OpenGL to be drawing anything outside its viewport,
or for SDL to flip anything to the screen that's outside the viewport.
There are numerous examples out there of OpenGL and various kinds of native
widgets existing in the same window, so I'd expect that SDL could be made to
do this as well. I suspect Sam just hasn't gotten around to it, since you
don't really need this for a game. But if you want to make something like
Maya, then you need it really badly.
More information about the SDL