The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
SDL_CreateWindow
MrTAToad


Joined: 13 Feb 2014
Posts: 205
Location: Chichester, England
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_CreateWindow
Sam Lantinga


Joined: 10 Sep 2009
Posts: 1765
What platform are you seeing this on?

On Sat, Sep 27, 2014 at 4:29 AM, MrTAToad wrote:
Quote:
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

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

MrTAToad


Joined: 13 Feb 2014
Posts: 205
Location: Chichester, England
Windows
MrTAToad


Joined: 13 Feb 2014
Posts: 205
Location: Chichester, England
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
Naith


Joined: 03 Jul 2014
Posts: 158
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.