The Wayback Machine - https://web.archive.org/web/20201029051937/https://github.com/LambdaHack/LambdaHack/pull/232
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fullscreen CLI option for SDL renderer #232

Open
wants to merge 3 commits into
base: master
from

Conversation

@MichaelMackus
Copy link

@MichaelMackus MichaelMackus commented Aug 30, 2020

Better way to do this would likely be to override the font scale when in fullscreen mode. This way, we can automatically change the font scale a good setting. However, the current results look great to me in 1080p with 1.5 font scale.

Related #221

1080p seems to look best to me with 1.5 font scale
@MichaelMackus MichaelMackus force-pushed the MichaelMackus:sdl-fullscreen branch from 805fc05 to 412e41f Aug 30, 2020
@Mikolaj
Copy link
Member

@Mikolaj Mikolaj commented Aug 30, 2020

Oh, cool, well done.

Regarding override, I'd rather keep commandline and config commands explicit and with separation of concerns. However, it would be nice to add, in another issue, an in-game keybinding that binds to a composition of three human commands (or more?): "set internal font scale to the system's default resolution, saving the old resolution somewhere", "reload the current fontset with the current font scale, saving the old fonts and their texture atlases in a map indexed by scale; if already in the map, just restore instead of reloading" and "go fullscreen". Preferably the commands would have inverses and then the keybinding could toggle fullscreen and we could also have a toggle 'fullscreen on/off' in the settings menu that just executes the keybinding. Feel free to open any issues about that and I'd help to flesh them out.

Edit: BTW, feel free to use cabal.project.local.development (by copying to cabal.project.local) for development. Or just set --disable-optimization, but the extra assertions help as well and the extra messy flags are supposed to minimize recompilation when switching to other configurations (I don't have time to review which are needed and if they are optimal).

windowConfig = SDL.defaultWindow {SDL.windowInitialSize = screenV2}
windowConfig = SDL.defaultWindow
{ SDL.windowInitialSize = screenV2
, SDL.windowMode = if sfullscreen then SDL.Fullscreen else SDL.Windowed }

This comment has been minimized.

@Mikolaj

Mikolaj Aug 30, 2020
Member

OOI, what would FullscreenDesktop do here?

This comment has been minimized.

@MichaelMackus

MichaelMackus Aug 30, 2020
Author

That is a "fake fullscreen" according to SDL wiki. So, I'm assuming, fullscreen windowed mode with no borders. We can add that as a separate config/CLI option, but I left it out here for simplicity.

This comment has been minimized.

@Mikolaj

Mikolaj Aug 30, 2020
Member

I've done some searching and it seems each of the modes don't work for some people. Do you think it would make sense to rename the option to windowMode and let the user specify any of the values that SDL accepts? The type has Read instance, so it should work fine. In config, by default, Windowed could be set.

This comment has been minimized.

@Mikolaj

Mikolaj Aug 30, 2020
Member

Actually, it's easier to just define own 3-value type. Otherwise, each frontend module would need to provide a (usually erroring out) parser for the type, I think. Too complex.

This comment has been minimized.

@MichaelMackus

MichaelMackus Sep 4, 2020
Author

I can look into this. So you are saying you want me to add different CLI options for e.g. --fullscreen and --fullscreen-windowed? Internally, I can see this being represented in the ClientOptions as a 3 value type like you mentioned.

This comment has been minimized.

@Mikolaj

Mikolaj Sep 4, 2020
Member

Thank you, I would be grateful. I guess I'd prefer to have the same schema in the config file and on command line. And in the config file, probably windowMode = FullscreenDesktop is natural and obvious. So --windowMode FullscreenDesktop.

@@ -69,6 +71,7 @@ defClientOptions = ClientOptions
, sallFontsScale = Nothing
, sfonts = []
, sfontsets = []
, sfullscreen = False

This comment has been minimized.

@Mikolaj

Mikolaj Aug 30, 2020
Member

Could you also, in a separate commit, add this to config file, just following closely how it's done for sallFontsScale?

This comment has been minimized.

@MichaelMackus

MichaelMackus Aug 30, 2020
Author

Yes, I was looking to add to config file but ran out of time.

@Mikolaj
Copy link
Member

@Mikolaj Mikolaj commented Oct 4, 2020

@MichaelMackus: hi! how is it going? need any help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.