View Full Version : Multiple Overlapping Viewports?

05-14-2000, 10:46 PM
At E3 this weekend I saw a very cool effect in (grumble) Microsoft's Mechwarrior. The effect was a zoomed in window in the center of the screen. This can be accomplished (I think) in OpenGL by using two calls to glViewport like such

glViewport(0,0,width,height); // Main Window
glViewport(350,250,450,350); // inner zoom window

However when I attempt to do something like this, fragments from the main window randomly overwrites the inner window... any ideas on what I can do to fix this? perhaps strategically placed glFlush calls? or PostRedisplay calls? Any help?


05-14-2000, 10:55 PM
I think you are having some problems with the depthbuffer. When you create a new viewport, you will still have the information from the previous viewport (colors and depth). Try to clear the viewport first with. Maybe no need to clear the colorbuffer, but you must clear the depthbuffer.

Just thoughts. Not even sure this is the way it works with viewports...

05-15-2000, 07:34 PM
Actually, that worked, thanks! All I had to do was clear the depth buffer.