A lot of game development APIs recently got support for multiple windows (such as SDL 2, and GLFW 3). But why did they add that feature? I've never seen a game in my life use multiple windows (with the exceptions of a launcher, or a messagebox). Is there something I'm missing here? Is there an actual game development purpose to it? I'm very confused of why they did that.
-
3\$\begingroup\$ I think its partly to improve support for multi-monitor configurations. \$\endgroup\$– TextmodeCommented Sep 29, 2013 at 10:31
-
1\$\begingroup\$ FWIW, Age of Empires II HD supports multiple monitors. You can stretch your game window across all monitors, thus giving you a much enlarged view of the game. \$\endgroup\$– me--Commented Sep 29, 2013 at 13:17
-
\$\begingroup\$ isnt 3d essentially a take on two viewports (oculus rift for example) \$\endgroup\$– RoughPlaceCommented Sep 29, 2013 at 18:12
-
1\$\begingroup\$ SDL and GLFW are not just for making games. \$\endgroup\$– Alistair BuxtonCommented Sep 29, 2013 at 18:50
-
1\$\begingroup\$ @me Can't you already stretch out stuff over multiple windows anyway (I don't know about fullscreen, but I assume it just adds all the resolutions up)? \$\endgroup\$– LiquidFelineCommented Nov 30, 2013 at 23:17
2 Answers
Things like this might not be as obvious or common so far, but it is used.
- With multiple windows you can create UI windows that may be dragged outside the game's main window (e.g. the cancelled MMO Wish supported this, although performance has been rather abismal back then).
- You can do other things with a secondary window, e.g. it could be useful when writing some kind of editor, where things such as palette selection or text editors are shown in a different window.
- Also back in the days (Windows 3.11 and Windows 95) it wasn't uncommon for games to use multiple windows and even default OS UI controls, especially for strategy titles, Deadlock and Civilization comming to my mind immediately.
- With multiple windows you can display different content on different screens without forcing the content to actually be continuous (or rather: it can be easier to handle, plus you can have different resolutions/sizes).
A few current-gen examples:
The Wii U and NDS, 3DS, and 2DS essentially run on two screens each, which could be considered two windows behind the scenes. If you want a non-Nintendo example, take a look at some mobile apps, the YouTube Android app. You can connect your tablet or smartphone to a TV and watch YouTube videos in 1080p while controlling playback using the far smaller touch screen device (with a lower resolution).
I can't tell you exactly why they added it, because I'm not privy to their motivations, but the most likely reason is of course that games can use it.
You also asked if there is a purpose to it. There are many game types that could use it. MMOs, RPGS, simulator and RTS games are sometimes so complex that you need to monitor a large amount of information in real time. Multiple-monitors can help with that, but only if the game can make use of that by having multiple windows.
I can give you a concrete example of a game that could make good use of it: Kerbal Space Program. It's a simulator game in which you design and launch rockets and explore space.
So that's two screens that you need to keep an eye on. Currently, the game allows you to switch between the screens, but not view them both at once. If they could be windowed separately, the player could either give each window half of their primary monitor (or any ratio they want) or move one window to a second monitor.
That's just one example. Basically any game where viewing the game status from multiple perspectives at once can benefit from the feature.