EngoEngine / engo

Engo is an open-source 2D game engine written in Go.
https://engoengine.github.io
MIT License
1.75k stars 136 forks source link

Multi-monitor support #687

Open inkeliz opened 4 years ago

inkeliz commented 4 years ago

I remember one game called Supreme Commander, which has an amazing (or interesting) usage of dual-monitor. That game uses one screen to display the game itself, and another shows a tactical map. I found one image of that in action:

supcom2

It was a big surprise first time that I played this game, since no other game makes usage of my second monitor. That game doesn't require any additional setup, and it works out of the box with that behaviour.

Many other games take another approach, which renders the "same content" over multiple monitors. One of them is Software Inc, which has more simple support for multi-monitor (up to 8 monitors). They require some setup, which you can set the resolution, the offset (so the UI will have that offset) and render the game at multiple monitors.


Currently, it doesn't seem that Engo supports that kind of feature. The CreateWindow() uses glfw.GetPrimaryMonitor() , so:

  1. It doesn't expose a way to set each monitor manually. Because of that limitation, we can't spam multiple windows across all monitors (which may capable to work like Supreme Commander).

  2. It doesn't have a way to set support for "all monitors", which can act as a single monitor (so, a single Engo application handle all monitors as if it's a single monitor, like the Software Inc or racing games).


I'm not sure if GLFW has native support for that. I found very little information about cross-monitor screen/window. Some topics may suggest using AMD/NVidia specific API to make it happen, which might require more work than expected.

Noofbiz commented 4 years ago

This would be a very cool feature. I believe GLFW supports it naively, but I’m not sure how off the top of my head.