Wargus / stratagus

The Stratagus strategy game engine
GNU General Public License v2.0
626 stars 119 forks source link

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

Open akce opened 4 years ago

akce commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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.

timfel commented 4 years ago

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

akce commented 4 years ago

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).