SDL Full Screen/Window Change Dynamically

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

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 on other sites
and that http://www.libsdl.org/cgi/docwiki.cgi/FAQ_20SDL_5fWM_5fToggleFullScreen

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 on other sites
Quote:
 Original post by chbrulesI'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);

1. 1
Rutin
28
2. 2
3. 3
4. 4
5. 5

• 11
• 13
• 11
• 10
• 13
• Forum Statistics

• Total Topics
632952
• Total Posts
3009438
• Who's Online (See full list)

There are no registered users currently online

×