stratagus icon indicating copy to clipboard operation
stratagus copied to clipboard

Add a mode where the video resolution adjusts to match window or desktop size.

Open akce opened this issue 4 years ago • 4 comments

There's already a '-v mode' command line option, so maybe we could add a mode that means use the window/desktop resolution?

eg, -v window or -v desktop or -v dynamic.

Another question is, should this set a minimum window size?

akce avatar Jun 15 '20 05:06 akce

I started playing with a work-in-progress implementation here: dynamic-video-resolution

I ended up calling it dynamic (for now) so the name isn't tied to window or desktop as it should resize regardless of whether it's in windowed or fullscreen mode.

The next step is to hook it up to the lua preferences.

But anything and everything is up for change though so all feedback is appreciated :)

akce avatar Jun 15 '20 08:06 akce

I've updated to include lua bindings.

It's probably about complete for what can go into the engine.

Hopefully it's on the right track.

akce avatar Jun 16 '20 00:06 akce

This looks to me to be on the right track :)

timfel avatar Jun 17 '20 04:06 timfel

Thanks Tim :)

I've just updated my branch to include a ResolutionChanged event (or callback) because the games themselves (like Wargus) would need to handle resolution changes. If they want to that is...

I wasn't sure where to document this so I've added a new doc file: doc/scripts/events.html

I couldn't find docs for some other events/callbacks (GameStarting, MapLoaded, EditUnitProperties), so we could write something up for them in this file too.

I still need to check the title page drawing (which i suspect is completely handled by stratagus) and the main menu (which might be on the game side).

akce avatar Jun 27 '20 07:06 akce