SDL_CreateWindow

I have found that when creating a full screen (by passing the SDL_FULLSCREEN value) to SDL_CreateWindow, I can’t toggle between full and window mode properly (the renderer seems to be destroy or is no longer valid for some reason), and you just get a corrupt window.

However, by not passing this value and then immediately call SDL_SetWindowFullscreen to set full screen, everything is okay.

What platform are you seeing this on?On Sat, Sep 27, 2014 at 4:29 AM, MrTAToad wrote:

I have found that when creating a full screen (by passing the
SDL_FULLSCREEN value) to SDL_CreateWindow, I can’t toggle between full and
window mode properly (the renderer seems to be destroy or is no longer
valid for some reason), and you just get a corrupt window.

However, by not passing this value and then immediately call
SDL_SetWindowFullscreen to set full screen, everything is okay.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Windows

The window is created with :

Code:
m_window = SDL_CreateWindow(windowTitle.c_str(), SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,
sW, sH,
SDL_WINDOW_SHOWN | SDL_WINDOW_INPUT_FOCUS |
SDL_WINDOW_MOUSE_FOCUS |
(fs ?_fullScreenValue : 0) | SDL_WINDOW_ALLOW_HIGHDPI);

_fullScreenValue is SDL_WINDOW_FULLSCREEN_DESKTOP

I have the same problem (on Windows) and I’m using SDL_WINDOW_FULLSCREEN as one of the flags in the SDL_CreateWindow function.

I have the same problem (on Windows) and I’m using SDL_WINDOW_FULLSCREEN as one of the flags in the SDL_CreateWindow function.

As MrTAToad wrote, I’m creating a window in fullscreen mode, render some textures, switching to window mode and the whole window goes black (renderer is destroyed or something).
If I create the window in window mode, switch to fullscreen mode and back to window mode, everything works as it’s supposed to.