by Baker » Tue Apr 12, 2011 4:06 am
It was like jamming toothpicks into my eyes, but the vague version goes like this:
Cheat Version:
The Cheat Version works 100%. Think of it like this, when Quake goes fullscreen, it changes the display mode. But when you quit Quake, it resets it. Since multiple different video cards doesn't play nice with OpenGL as it is implemented in Windows, just switch the primary monitor and restore it upon exit.
1. Use EnumDisplayDevices to populate a list of monitors. One option is just to stop at 2 monitors as I don't have a 3 or monitor system to test with anyway.
2. Set the secondary monitor to position 0,0 after setting the [formerly] primary monitor position to (secondary_monitor_pixel_width_x, 0).
3. Kapowie ... the rest of Quake works as-is. Even if using, like I do, something like MH's Direct3D wrapper.
4. In shutdown, restore the original settings.
Obviously, 2 different Quake .exes cannot run on 2 separate monitors in this scenario.
"Real Version":
1. Get the monitor information like #1 in the above.
2. Do CreateWindowEx using the secondary monitor _origin_x and origin_y as the top right. GetDC and the rest work as expected.
3. ChangeDisplaySettings accepts as the first parameter the DisplayDevice. Set this DisplayDevice to be the secondary monitor name.
4. From this point forward, everything else works the same. Except if you literally have 2 video cards like my desktop, Windows apparently is not-prepared to handle this and it results in an uber fail with a black screen or white screen [depending on how you choose to clear the screen after initializing the window with PalBlt or what not]. But it does work with a single display adapter, like my laptop, which supports multiple monitors via the single display adapter.
Extra note: Generally, you have to use Microsoft Visual Studio 2008 or later (maybe older Visual Studio .NET versions work, but not MSVC6 ... unless you have Windows 2003 server SP1 SDK, which isn't available on the internets anymore). In some ways, I over-dedicated time to solve this issue, but I'm very stubborn and kept at it until I achieved what I considered an acceptable solution. I didn't like the idea of sitting at the doorstep of the solution without being able to open the actual effin door.
The night is young. How else can I annoy the world before sunsrise?

Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..