Roger Wilco
Roger Wilco

Reputation: 102

Setup OpenGL for multiple monitors

I am beginning OpenGL programming on a Windows 7 computer and my application is made up of fullscreen windows where there is a separate window and thread for each monitor. What are the steps I have to take to have a continuous scene? I am still confused about many OpenGL concepts and how I should handle this. Is it basically the same as single monitor render except with view matrix and context extra work, or is it more complicated?

EDIT: I found a website with information, but it is vague and without example code: http://www.rchoetzlein.com/theory/2010/multi-monitor-rendering-in-opengl/

Upvotes: 3

Views: 4704

Answers (1)

BlamKiwi
BlamKiwi

Reputation: 2193

My first question would be why do you need two different OpenGL windows?

Have you considered the solution that the games industry has been using already? Many 3D applications and games that support multi-monitor setups don't actually manage their own separate windows, but let the GPU manage rendering over multiple screens. I used this in a project this year to have an oculus rift view and a spectator view on a TV screen. I didn't manage two OpenGL scenes, just two different "cameras".

http://www.amd.com/en-us/innovations/software-technologies/eyefinity

http://www.nvidia.com/object/3d-vision-surround-technology.html

Pros

  • Easier to code for. You just treat your code as being one scene, no weird scene management needed.
  • Graceful degradation. If your user only has one screen instead of two your app will still behave just fine sans a few UI details.
  • Better performance (Anecdotal). In my own project I found better performance over using two different 3D windows.

Cons

  • Lack of control. You're at the behest of driver providers. For example nVidia surround requires that GPUs be setup in SLI for whatever reason.
  • Limited support. Only relatively new graphics card support this multi monitor technology.
  • Works best wheen screens are same resolution. Dealing with different aspect ratios and even resolutions of the same aspect ratio can be difficult.
  • Inconvenient. The user will have to setup their computer to be in multi monitor mode when they may have their own preferred mode.

Upvotes: 3

Related Questions