Qt and openGL - multiple (dual) video-cards, viewports, monitors
Hello,
i already worked with qt but not with qt-openGL (or only very little).
For my current project i need to render a 3D-room. I might want to use a 3D-engine but i am considering using openGL and qt (i am not sure if it sufficient to use openGL to create the 3D-room).
One problem is i need a player with 2 eyes and want to render one viewport for each eye. To start with i want to try and show the two viewports on 2 monitors (probably using two video-cards).
Is this possible with qt? And is someone here who knows which classes i need to build a sample project? I first want to evaluate the possibility to do this with qt so i can decide how to start the project.
Re: Qt and openGL - multiple (dual) video-cards, viewports, monitors
Look at QDesktopWidget documentation for information about multi-head systems. By determining whether the target system has a virtual desktop or more than one screen, you can decide how and where to position your viewports. Look at QGLWidget for information on using OpenGL within Qt. Plenty of examples in the Qt distribution on using OpenGL, so look at those too.
Re: Qt and openGL - multiple (dual) video-cards, viewports, monitors
Quote:
Originally Posted by
d_stranz
Look at
QDesktopWidget documentation for information about multi-head systems. By determining whether the target system has a virtual desktop or more than one screen, you can decide how and where to position your viewports. Look at
QGLWidget for information on using OpenGL within Qt. Plenty of examples in the Qt distribution on using OpenGL, so look at those too.
Thank you for your answer.
My idea is to make two widgets which inherit from QGLWidget without a parent and make them fullscreen on the screens. This is already working manually, i will check later if i can use QDesktopWidget to automatically do this (priority is with the opengl-scene at the moment).
To link them i wanted to make some object which inherits QObject and connect some of it's signals to slots of the opengl-widgets.
Any advice on this?
Re: Qt and openGL - multiple (dual) video-cards, viewports, monitors
I think that when you make QWidget instances with no parent, they automatically become children of QDesktopWidget, but I am not sure of this. You'll still need to check screen count and geometry in order to size and position them properly on any display configuration.