Rendering outside of window on second monitor


I have a dual monitor system with two graphics cards. The primary display is an ATI Rage Pro, the secondary is a 3Dlabs Wildcat II 5110. (I know, it’s old hardware.) As I have seen mentioned in a few posts, if I create a window on the secondary monitor and draw into it, nothing shows up. No errors are reported. While trying a variety of ways to deal with this, I stumbled across the answer for why nothing is showing up!

If I move the window from the secondary monitor (btw, it is placed to the right of the primary monitor in the Display Settings) to the primary monitor, I am able to see the graphics displayed - on the secondary monitor! The window frame, etc., are on the primary monitor, but the graphics are being rendered to the secondary monitor. The location on the secondary monitor where the rendering is occuring is the location of the window client area on the primary monitor.

I queried the origin of the DC for the window after it was created, and found that it was reported relative to [0,0] on the primary monitor. (For example, [1800,200] for a primary monitor with a screen size of [1600,1200].) I am guessing that somehow OpenGL is using that same offset, but referencing it to the origin of the secondary monitor. As a result, the graphics are being rendered completely off-screen. Then, when I move the window frame onto the primary monitor, everything is translated down by 1600 pixels or so, and the graphics become visible on the secondary monitor.

So, my question is, how do I fix this problem? There doesn’t seem to be any SetDCOrgEx call in GDI. I tried changing the WindowOrg and ViewportOrg, but even a 1 pixel change in either of those caused my graphics to stop rendering - not even in the strange way they had been rendering.

As I know, you cannot fix this problem, because OpenGL doesn’t support multiple displays, especially if they are on different graphics cards. Think about it! You’ve created a rendering context for your ATI card. This means that the resources of the ATI card are used. When the window reaches the other display, OpenGL still uses the ATI card’s resources, nothing is sent to the 3Dlabs card. This is not only because of the incorrect offset, but because of the nature of OpenGL. I don’t think any 3D API can do this. That would mean that OpenGL should know when and which parts of the rendering should be done on the ATI and the 3Dlabs card. This would mean some kind of CrossFire/SLI like support between these two cards which is impossible as I know.

NVidia drivers is smart enough so if you have multiple NV cards setup OpenGL acceleration work on all NV cards, so you can resize app window over all monitors.

With different cards setup problem is in Windows itself… Actually windows support only one ICD driver and app cannot create gl contex on secondary display adapter. Maybe it is possible to load ogl driver manualy (a dll file), map all entry points and initialise context on specific card.

This is entirely up to the implementation. For example, Mac OS X has supported exactly this situation for years-- a single rendering context driven by multiple heterogenous devices (different vendors.) As you drag a window across multiple displays, the current renderer changes to the one that is rendering “most” of the window. It is up to the application to respond appropriately when the current renderer changes.

I have the same problem on a Vista machine but i use only one NV card. First monitor shows the backbuffer, second one shows garbage.

Does it work with just one of the two cards?

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.