beyond-all-reason / spring

A powerful free cross-platform RTS game engine
https://beyond-all-reason.github.io/spring/
Other
178 stars 95 forks source link

[Feature] Specify extra viewports from Lua #1567

Open MasterBel2 opened 4 days ago

MasterBel2 commented 4 days ago

E.g. this OpenTTD feature: https://wiki.openttd.org/en/Manual/Extra%20Viewport

Like how lua can specify drawing of the minimap, I'd love to build a widget that provides viewports onto different areas of the map, layered within the UI. I'm imagine each viewport would trigger its own series of DrawWorld callins. Is this at all feasible from a performance point of view? I do anticipate it being very expensive, but still hope it can work.

I imagine the utility of this could be increased with multi-window support (for purposes of multi-screen support I imagine) especially if Lua has full freedom to determine what UI gets drawn where? I don't know how multi-screen support currently works, so I hope to look into that in the coming days.

Ultimately, this would give Lua full control of what gets drawn where, when, and how.

sprunk commented 4 days ago

Sounds like you could emulate it already in 2010 but no code seems to have survived https://springrts.com/phpbb/viewtopic.php?f=23&t=24485 Though that seems to have been a "manual" rendering.