PDA

View Full Version : Overlapping Viewports



McWare
01-29-2004, 07:25 AM
Hi,
I'm having some problems with my Viewports.
I have a window with 2 viewports in it. The main viewport draws the scene, then the 2nd viewport draws the world orientation.

My problem is that after a rotation/translate, I immediately call my draw routine to redraw the views. When I do this, the main scene is now drawn in the world orientation viewport, and the main viewport is blank.
Here's the pseudo:

OnDraw {
PushMatrix();
DrawScene();

glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
//Setup small overlapping viewport in lower corner. (glOrtho)
glMatrixMode(GL_MODELVIEW);

glLoadIdentity();
DrawOrientation();

glMatrixMode(GL_PROJECTION);
glPopMatrix(); //Reset to large viewport
glMatrixMode(GL_MODELVIEW);

glPopMatrix();

}

Am I missing something? Let me know if this needs clarification.