View Full Version : opengl mdi, qt, and viewport

04-13-2012, 07:53 AM
I modified a 3d engine for the qt library, i have inserted a opengl scene in a simple widget.
The problem is that i have try to create a mdi opengl application, then i can have more than one viewport with inside a different opengl scene.
The engine(wild magic5) is built for only one viewport.
Now if i try to create more than one subwindow ,only the lastest have a correct visualization.
The other windows are black and draw nothing.
How i can create multiple vieport in opengl?
I think to call glviewport(x,x,x,x) in the render function on the widget, but i have a doubt:
now all viewport coordinates are 0,0,100,100 , but i have access to mdisubwindow object from the render function, but what coordinates i must use? how i can do?

04-13-2012, 09:34 AM
It is explained here in the case of Windows

If you are on another OS, such as *nix, then the function is

I don't know about QT but perhaps it has its own function call that wraps on wgl or glX or whatever.