arescentral / antares

A tactical space combat game
http://arescentral.org/antares/
GNU Lesser General Public License v3.0
100 stars 18 forks source link

Instant fullscreen via video options screen #477

Open chaimleib opened 5 months ago

chaimleib commented 5 months ago

Clicking the "Fullscreen" checkbox in Options > Video now instantly toggles fullscreen mode, rather than waiting for the next game launch.

In macOS, the green fullscreen button in the window titlebar has the same effect.

In Linux, alt-Enter continues to toggle fullscreen as before.

I tested this using both macOS Sonoma 14.2.1 and Asahi Fedora Remix on a 16" MBP M1 Max.

chaimleib commented 5 months ago

Problem on Linux: when starting in windowed mode, the pixel doubling (especially in the fonts) is fuzzy, and scrolling text flickers. Toggling fullscreen back and forth fixes the fuzziness, but also makes it tiny.

Screenshot_20240108_151527

chaimleib commented 5 months ago

I think the fuzziness comes from fractional screen scaling. I played around with the OS display scale factor (150%, then 200%, then 100%) and fullscreen, and the problem disappeared. Now it's always tiny and not fuzzy on Linux. I can't reproduce the fuzziness anymore.

In another PR, it would be nice if the graphics were pixel doubled, but fonts rendered at 2x on hi-res displays.

chaimleib commented 5 months ago

Bug: When alt-Enter is used to toggle fullscreen, using the video options checkbox afterwards during the same launch will not apply the change until next launch.

sfiera commented 3 months ago

Sorry, I forgot what the status of this PR was. There was the matter of the function signature change and the bug you mentioned above. Were you aiming to merge this as-is or to refine further?

chaimleib commented 3 months ago

I don't think this PR is ready to merge, because the different fullscreen methods can get out of sync.