Thanks for the help!
On further examination, it seems like all textures loaded while the
application is fullscreen are lost on context switch, while textures loaded
while windowed are not. It may be worth it for someone to double check and
Just switch to windowed and immediately back to fullscreen at the new
I tried this, and it seems to work. ( Thanks! ) However, I’m encountering
a strange situation:
Starting the application in fullscreen mode and then going to windowed
mode results in the SDL app losing all its textures, and I need to reload
them. However, starting the application in windowed mode lets me switch
back and forth between fullscreen and windowed mode any number of times
without any need to reload textures.
Is this expected behavior, and is there any way to avoid this loss of
On Sun, Jun 1, 2014 at 12:11 AM, Arvind Raja Yadav < @Arvind_Raja_Yadav> wrote:>
So if I understood the discussion correctly, SDL_SetWindowSize is not a
valid function to call when in fullscreen mode (the documentation needs to
be updated for this, I believe).
I have to use the “classical” fullscreen mode in my application, which is
why I cannot use SDL_FULLSCREEN_DESKTOP sadly.
I could use some help on a valid way to change resolution while in
fullscreen mode. Here’s the method I tried using SDL_DisplayMode, which
didn’t work - the resolution stays the same no matter what values I give to
mode.w and mode.h :
//Check the current window flagsUint32 flags = SDL_GetWindowFlags(gWindow);
//Are we in fullscreen mode right now?if ((flags & SDL_WINDOW_FULLSCREEN) == SDL_WINDOW_FULLSCREEN)
//Use the DisplayMode way of resizing screen
mode.w = gScreenSettings.cur.w;
mode.h = gScreenSettings.cur.h;
SDL_SetWindowSize(gWindow, gScreenSettings.cur.w, gScreenSettings.cur.h);
SDL_SetWindowPosition(gWindow, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED);
Did I just use SDL_SetWindowDisplayMode incorrectly, or is something
On Sat, May 31, 2014 at 4:39 PM, Arvind Raja Yadav < @Arvind_Raja_Yadav> wrote:
Yes, SDL Doesn’t allow resolution change once it goes fullscreen.
You could just use the Desktop Resolution instead. Then you can
use? SDL_RenderSetLogicalSize() to maintain the aspect ratio.
If you really want to change resolution then you could go: Fullscreen
-> Windowed -> (delay) -> Size Change -> (Delay) -> Fullscreen.
I cannot use the logical size portion of the SDL Renderer, as I handle
the size/aspect ration stuff in code myself.
To me, this is definitely a bug in SDL2 - nothing in the documentation
suggests you can’t change resolution while in fullscreen mode. Changing
resolution while in fullscreen is a fairly common scenario as well - lots
of other games allow you to do the same thing.
Arvind Raja Yadav
Pyrodactyl Games http://pyrodactyl.com/