Fullscreen mode fix

Fullscreen mode fix

Postby endoalir » 13 Jun 2013, 07:41

So, I found out why fullscreen mode was going crazy. There is in fact an environment variable that SDL looks for which controls the behavior of fullscreen mode when there are multiple monitors involved. If there are multiple monitors and the environment variable is missing, strange things happen.

I made a fork of Valyria Tear with a patch to set this variable. I put it in main because it has to be set before SDL initializes, so I put it just before that happens.

https://github.com/endoalir/ValyriaTear
endoalir
 
Posts: 2
Joined: 13 Jun 2013, 01:15

Re: Fullscreen mode fix

Postby Bertram » 13 Jun 2013, 12:43

Hi endoalir and welcome to the team! :D

So, I found out why fullscreen mode was going crazy. There is in fact an environment variable that SDL looks for which controls the behavior of fullscreen mode when there are multiple monitors involved. If there are multiple monitors and the environment variable is missing, strange things happen.

I made a fork of Valyria Tear with a patch to set this variable. I put it in main because it has to be set before SDL initializes, so I put it just before that happens.


This is excellent news!

May I assume that as a result, the game goes on the main screen now in fullscreen?

I may cherry-pick your commits but for the sake of simplicity, I would advise you to squash your two commits (see git rebase -i) and do a pull request on github.
Can you do that?

Best regards,
User avatar
Bertram
VT Moderator
 
Posts: 1652
Joined: 09 Nov 2012, 12:26

Re: Fullscreen mode fix

Postby endoalir » 13 Jun 2013, 20:10

Done. Yes it will use the main screen. You can, in fact, switch it to use the an alternate screen like so:

SDL_VIDEO_FULLSCREEN_DISPLAY=1 src/valyriatear

The fact that SDL works like this probably would make it awkward to try to hot swap screens for full screen mode. I'm going to see about implementing an option to cause full screen mode to use a different monitor. It'll just require the application to be restarted to take effect.

** EDIT
I added that option in my fork now. The video menu has an option to select the monitor to use. I didn't see an obvious way to query how many monitors there are so I just made it toggle from 1-5.

Also, I made things work when multiple joysticks are involved. There, those are the two things I wanted most when I played it through.
endoalir
 
Posts: 2
Joined: 13 Jun 2013, 01:15

Re: Fullscreen mode fix

Postby Bertram » 14 Jun 2013, 08:33

Hi :)

I've started looking at your commits. There are good things in there. I hope it'll end up in a merge.

Regards,
User avatar
Bertram
VT Moderator
 
Posts: 1652
Joined: 09 Nov 2012, 12:26

Re: Fullscreen mode fix

Postby dimproject » 02 Oct 2013, 21:46

My monitor have resolution 1366 x 768 and
not convenient using resolution 1024 x 768
in full-screen mode.
dimproject
 
Posts: 212
Joined: 18 Jul 2013, 13:51

Re: Fullscreen mode fix

Postby Bertram » 03 Oct 2013, 08:44

Hi there,

You're completely right!
It's been reported a few times already and I really should take care of that asap.
I'll add those ones:
- 1366x768
- 1440x900

Are there any other that would need to be added?

On a side note, the sdl2 port of the game is mainly done. Once it's production ready, note that I made it use the current desktop resolution when in fullscreen. (this shall help for such cases.).

Regards,
User avatar
Bertram
VT Moderator
 
Posts: 1652
Joined: 09 Nov 2012, 12:26

Re: Fullscreen mode fix

Postby dimproject » 02 Dec 2013, 21:46

-1600x900
I was testing developing version (built in Codeblocks-12.11MinGW).
Still not convenient using
resolution 1024x768 (my monitor have resolution 1366x768)
in full-screen mode. :(
In Options, Video, Map tiles - value don't save after Quit (always Smoothed).
dimproject
 
Posts: 212
Joined: 18 Jul 2013, 13:51

Re: Fullscreen mode fix

Postby Bertram » 02 Dec 2013, 22:55

Still not convenient using
resolution 1024x768 (my monitor have resolution 1366x768)
in full-screen mode. :(

This was fixed in the sdl2 branch by using the current desktop resolution in fullscreen
but I still need to adapt the viewport to support non-4:3 resolutions.

Once I've added support to that to both branches, I'll add the requested resolutions.

In Options, Video, Map tiles - value don't save after Quit (always Smoothed).

Not a bug, this is actually feature. Before it was saved but this option looks awful with the rest of the map objects when map tiles are not smoothed.
I should remove it to avoid future questions, in fact.
User avatar
Bertram
VT Moderator
 
Posts: 1652
Joined: 09 Nov 2012, 12:26

Re: Fullscreen mode fix

Postby Bertram » 04 Dec 2013, 00:30

Hi again,

The map tile smoothing options has been removed and support for non 4:3 resolutions was finally added. :)
You can try the 1366x768 resolution in the master branch.
User avatar
Bertram
VT Moderator
 
Posts: 1652
Joined: 09 Nov 2012, 12:26

Who is online

Users browsing this forum: No registered users and 1 guest

cron