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
[2.0.3]-Full Screen Desktop Fails On Linux?
JeZ-l-Lee


Joined: 20 Sep 2009
Posts: 572
Location: Long Island, New York, United States, Earth
[2.0.3]-Full Screen Desktop Fails On Linux?

Hi,

We are trying to make a cross-platform game using SDL2 v2.0.3.
We have everything working 100% on Microsoft Windows platform.

We have a problem with full screen desktop failing to work on Linux(Linux Mint 17.1 KDE 64Bit)?
Here is our code:
Code:
if (visuals->FullScreenMode == false)  SDL_SetWindowFullscreen(visuals->Window, 0);
else if (visuals->FullScreenMode == true)  SDL_SetWindowFullscreen(visuals->Window, SDL_WINDOW_FULLSCREEN_DESKTOP);

Is there a problem with our source code which would make full screen desktop fail to work properly on Linux?
Again, it works 100% perfectly on Microsoft Windows platform.
Thanks in advance!
JeZ-l-Lee


Joined: 20 Sep 2009
Posts: 572
Location: Long Island, New York, United States, Earth
Hi,

We got full screen desktop working now on Linux.
You have to unload all textures before changing the game's window
and then reload all textures after...

Thanks!
JeZ-l-Lee


Joined: 20 Sep 2009
Posts: 572
Location: Long Island, New York, United States, Earth
Hi,

We spoke too soon...
Full screen desktop is again not working on Linux(Linux Mint 17.1 KDE 64Bit)?
Anyone know why?
(it's SDL2 ver. 2.0.2 from Synaptic Package Manager)

Here is a screenshot:
Christian Knudsen


Joined: 14 Nov 2009
Posts: 37
Are you also setting the window size to match the desktop resolution?
JeZ-l-Lee


Joined: 20 Sep 2009
Posts: 572
Location: Long Island, New York, United States, Earth
Christian Knudsen wrote:
Are you also setting the window size to match the desktop resolution?
Hi,

How would I do that?
I mean which SDL2 functions would I use?

Thanks...
Christian Knudsen


Joined: 14 Nov 2009
Posts: 37
https://wiki.libsdl.org/SDL_GetCurrentDisplayMode
https://wiki.libsdl.org/SDL_SetWindowSize
JeZ-l-Lee


Joined: 20 Sep 2009
Posts: 572
Location: Long Island, New York, United States, Earth
Hi,

Ok, so I think we've fixed full screen desktop mode on Linux.
You have to both reload textures and reinitialize the renderer...

Original forum post for mailing list members:
https://forums.libsdl.org/viewtopic.php?t=11240