[SDL] Frameless/splash window

Samuel Hart criswell at geekcomix.com
Fri Aug 31 08:24:00 PDT 2001

On Friday 31 August 2001  3:44am, Benjamin Niemann wrote:
> On Thursday 30 August 2001 21:36, you wrote:
> > On Thursday 30 August 2001  9:11am, Roger Durañona Vargas wrote:
> > > How can I make a frameless window (like xmms) or a splash image with
> > > SDL?
> >
> > [snip]
> > 3) Toggle the SDL_NOFRAME flag on your screen surface -For example, if
> > your surface is called "screen", you'd have a line like this:
> > 	screen->flags |= ~SDL_NOFRAME;
> First I thought this was a typo...
>   |= ~SDL_NOFRAME  sets all bits except SDL_NOFRAME, which is already set!

You're right, but it's the only thing that I ever could figure out that would 
work (I was a shocked as you are ;-)

> What's happening on the next SDL_SetVideoMode is (when I interpret the
> source correctly): SDL thinks the current display has SDL_OPENGL enabled,
> but you don't request it in your new flags. SDL will then close the current
> window and open a new one, probably because it can't change the
> opengl-what-ever on the fly.
> Usually SDL tries to resize the window, but it seems to fail to change the
> window's frame on the fly. If there's no other way to fix it, SDL should
> close old/open new window when the SDL_NOFRAME flag changed (as I already
> suggested).

You mean shutting down and restarting the SDL_VIDEO subsystem, right?

When all you want is a simple splashscreen, this isn't very practical.

Ideally what should happen (and what I would expect to happen) is when you 
re-call SDL_SetVideoMode(...) without SDL_NOFRAME it would wipe out the 
previous SDL_NOFRAME flag. As it stands now, this doesn't work, so you need 
to do some sort of kludge (like listed above) if you really want it to work.

If I a) had time and b) had the ability, I'd look into the SDL source code 
and see what's up. Unfortunately, I have neither ;-)

Sam "Criswell" Hart <criswell at geekcomix.com> AIM, Yahoo!: <criswell4069>
Homepage: < http://www.geekcomix.com/snh/ >
PGP Info: < http://www.geekcomix.com/snh/contact/ >
Tux4Kids: < http://www.geekcomix.com/tux4kids/ >

More information about the SDL mailing list