[SDL] Dynamically changing video mode flags

Samuel Hart criswell at geekcomix.com
Wed Aug 22 14:29:01 PDT 2001

I have figured out a way to do this, I change the flags member of the screen 
surface's struct:

 screen->flags |= ~SDL_NOFRAME;

Actually, this is the obvious way of doing it, but I have been avoiding 
trying it because the SDL docs say that this member is *read only*.

Can anyone give me a reason why I /shouldn't/ do this? (What problems it may 
cause? If none, then I'll just do this....)

(my original question follows)

On Wednesday 22 August 2001 11:51am, Samuel Hart wrote:
> Is there is a way to change certain video mode flags without having to quit
> and restart the video subsystem?
> For example (and this is what I specifically need), lets say you want an
> initial screen (such as a splashscreen) to be displayed without a window
> frame (using the SDL_NOFRAME flag with SDL_SetVideoMode). After this
> screen, you want to have the main window of your application (which will
> likely be a different size than the splashscreen) have frames.
> If you call SDL_SetVideoMode again, you can change the size of the screen,
> and add additional flags, but the SDL_NOFRAME flag will still be set.
> I have tried to use various bitwise operators to wipe out the SDL_NOFRAME
> setting, but these haven't worked. The only thing which has worked has been
> to quit the video subsystem, and then restart it (which seems like an awful
> lot of work, and can even cause a short period where the new screen cannot
> be blitted to).
> Barring any complaints anyone has about me using a splashscreen (trust me,
> for this app, this is the way I want to do it ;-)... is there a way to
> re-enable frames without stopping/restarting the video subsystem?
> (For those who want to look at code, the particular project this is for is
> TuxReader: http://www.geekcomix.com/dm/tuxread/ , which requires SDL,
> SDL_image, SDL_net, SDL_ttf, and optionally the Festival speech synthesis
> system).

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

More information about the SDL mailing list