Jump to content
  • Advertisement
Sign in to follow this  
chbrules

SDL Full Screen/Window Change Dynamically

This topic is 4780 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Does SDL support the ability to switch between windowed mode and fullscreen by simply making the screen surface equal to another definition? I've tried it before and it just crashed windows into hell. I did it like so:
screen = SDL_SetVideoMode(_WINDOW_WIDTH_, _WINDOW_HEIGHT_, _BIT_RATE_, SDL_HWSURFACE | SDL_DOUBLEBUF);
say I make some switch case or something which would make screen equal to something else depending on what key is pressed?
screen = SDL_SetVideoMode(_WINDOW_WIDTH_, _WINDOW_HEIGHT_, _BIT_RATE_, SDL_HWSURFACE | SDL_DOUBLEBUF | SDL_FULLSCREEN);
I'm just wondering if it's possible because I haven't had luck doing so.

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
read this http://www.libsdl.org/cgi/docwiki.cgi/SDL_5fWM_5fToggleFullScreen
and that http://www.libsdl.org/cgi/docwiki.cgi/FAQ_20SDL_5fWM_5fToggleFullScreen

Share this post


Link to post
Share on other sites
It does support that on certain platforms. But unfortunately that isn't on the Windows platform. The linux platform though is supported.

Share this post


Link to post
Share on other sites
Quote:
Original post by chbrules
I'm just wondering if it's possible because I haven't had luck doing so.


All you need to do is add in the flag: SDL_RESIZABLE and it *should* work. I just tried it, with my post here, and it worked for me just fine - ie no crashes. See if that works.


screen = SDL_SetVideoMode(_WINDOW_WIDTH_, _WINDOW_HEIGHT_, _BIT_RATE_, SDL_HWSURFACE | SDL_DOUBLEBUF | SDL_RESIZABLE);

...

screen = SDL_SetVideoMode(_WINDOW_WIDTH_, _WINDOW_HEIGHT_, _BIT_RATE_, SDL_HWSURFACE | SDL_DOUBLEBUF | SDL_FULLSCREEN | SDL_RESIZABLE);

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!