Page 1 of 1

Fullscreen mode fix

PostPosted: 13 Jun 2013, 07:41
by endoalir
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

Re: Fullscreen mode fix

PostPosted: 13 Jun 2013, 12:43
by Bertram
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,

Re: Fullscreen mode fix

PostPosted: 13 Jun 2013, 20:10
by endoalir
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.

Re: Fullscreen mode fix

PostPosted: 14 Jun 2013, 08:33
by Bertram
Hi :)

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

Regards,

Re: Fullscreen mode fix

PostPosted: 02 Oct 2013, 21:46
by dimproject
My monitor have resolution 1366 x 768 and
not convenient using resolution 1024 x 768
in full-screen mode.

Re: Fullscreen mode fix

PostPosted: 03 Oct 2013, 08:44
by Bertram
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,

Re: Fullscreen mode fix

PostPosted: 02 Dec 2013, 21:46
by dimproject
-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).

Re: Fullscreen mode fix

PostPosted: 02 Dec 2013, 22:55
by Bertram
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.

Re: Fullscreen mode fix

PostPosted: 04 Dec 2013, 00:30
by Bertram
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.