LuaSTG-Sub icon indicating copy to clipboard operation
LuaSTG-Sub copied to clipboard

Borderless Fullscreen Implementation

Open KaleiAlma opened this issue 1 year ago • 3 comments

Added new API for changing window mode:

-- int, int, bool, int
lstg.VideoModeWindowed(width, height, vsync, monitor_index)
-- int, int, bool
lstg.VideoModeFSExclusive(width, height, vsync)
-- int, int, bool, int
lstg.VideoModeFSBorderless(width, height, vsync, monitor_index)

Note that system monitor indexes will not always be in the same as the order used by LuaSTG. Perhaps that could be looked into?

lstg.ChangeVideoMode() has stayed compatible with older revisions (I saw there were changes made a while back, but they were reverted at some point).

KaleiAlma avatar Feb 22 '24 11:02 KaleiAlma

Fullscreen mode has been managed by the engine. Maybe you didn't read the changelog of v0.20? Canvas Mode Update

Demonese avatar Feb 22 '24 12:02 Demonese

There doesn't seem to be an API to select which one is preferred, leading some developers to be dissatisfied with the implementation (as they receive Exclusive when Borderless is preferred), and denying the option to implement a settings menu to allow users to change between fullscreen modes as they wish.

Besides, I couldn't find a point where Borderless fullscreen was properly implemented. Borderless fullscreen more closely resembles Windowed mode than Exclusive fullscreen (Borderless fullscreen is actually just a full-screen window with WS_POPUP style, and the swapchain must not be set to fullscreen).

Lastly, I saw you changed the behavior of lstg.ChangeVideoMode() in 677f56e9ee91851e962a945de1e081a95ec9bc79, but it got reverted in 934557d01aeec593bd950dd3a32303c18b2fbbd9. I believe it'd be easier to use separate functions for this new API, and lstg.ChangeVideoMode() could stay for backwards-compatibility.

KaleiAlma avatar Feb 22 '24 13:02 KaleiAlma

After a long period of thinking and testing, I designed a new set of APIs that are more scalable.

https://github.com/Legacy-LuaSTG-Engine/LuaSTG-Sub/pull/38

It still lacks explicit config of exclusive fullscreen and related display mode (resolution, refresh rate, etc.). I'm in discussions with other developers about further development.

Demonese avatar Sep 26 '24 09:09 Demonese