Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 5 of 5

Thread: 2 fullscreeen viewports on 2 monitors

  1. #1
    Intern Contributor
    Join Date
    Nov 2000
    Location
    Thuringia, Germany
    Posts
    89

    2 fullscreeen viewports on 2 monitors

    Hey all!

    long time since my last post

    I have the following problem:

    Setup:

    Windows, nvidia GF4+ with 2 monitors attached.

    I need a method of creating 2 viewports. both in fullscreen. first VP on monitor1, second VP on monitor 2. no GLUT or librarys. just plain windows.h

    so I want to render the scene from, lets say, someone who sits in a car and drives on a road on monitor1 and render the scene from an external viewer who looks at this car. the scene-management isn't the problem. my problem is:
    Creating the 2 Viewports, fullscreen, each on a separate monitor. Can I use GL_FRONT_LEFT and GL_FRONT_RIGHT buffers for that ?

    thanks for help!

    Sebastian

  2. #2
    Member Regular Contributor
    Join Date
    Aug 2003
    Location
    France
    Posts
    299

    Re: 2 fullscreeen viewports on 2 monitors

    The common method in professionnal visual systems to set up multiple viewports is to use mutiple PCs ... each being connected on a LAN and recieving a network message asking to render a frame from a certain position.

    If you're stuck with a single PC, I can't help as I don't know your answer ...

    SeskaPeel.

  3. #3
    Advanced Member Frequent Contributor
    Join Date
    Apr 2000
    Location
    Melbourne,Victoria,Australia
    Posts
    767

    Re: 2 fullscreeen viewports on 2 monitors

    I think, I could be wrong, that you need to create a window & Context on each of the monitors & then set each to fullscreen. So basically you create two windows, with the second one positioned at coordinates that will put it on the second monitor (Eg. 1024, 0 if you are running at 1024x768) - or you specifically tell the system that the new window will be created on the second monitor (I haven't looked into this).

    A simple test is to create a single window, and set it to fullscreen, as you normally would and see what happens (does it span the two monitors etc). Then create the window on the second monitor and do the same. Finally, combine the two and create both windows (assuming it works as expected).

  4. #4
    Junior Member Regular Contributor execom_rt's Avatar
    Join Date
    Jul 2000
    Location
    Canada
    Posts
    237

    Re: 2 fullscreeen viewports on 2 monitors

    You need to initialize a 2048x768 window (2x 1024 x 768). The left part will be (0,0)-(1023,767) and second part is (1024,0)-(2047x767).

  5. #5
    Senior Member OpenGL Guru
    Join Date
    Mar 2001
    Posts
    2,704

    Re: 2 fullscreeen viewports on 2 monitors

    execom and rgpc are both right; either way will work.

    I'd suggest using the single, very wide, desktop-spanning window, because it means you don't have to worry about context switching and sharing.

    When you render, you first glViewport() and glScissor() to render to the leftmost half of the window; render the driver view; then glViewport() and glScissor() to render the rightmost half; render the outside view; then SwapBuffers().
    "If you can't afford to do something right,
    you'd better make sure you can afford to do it wrong!"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •