I’m trying to get multiple viewports in a single window. In my Display function, I’m doing this:
wWindow = width of window
hWindow = height of window
for(int n=0; n<2; n++)
{
if (n==0)
{
glViewport (0, wWindow/2, hWindow/2, wWindow/2);
glScissor (0, wWindow/2, hWindow/2, wWindow/2);
glMatrixMode (GL_PROJECTION);
glLoadIdentity ();
gluPerspective( 10.0, wWindow/hWindow, 0.1f, 500.0 );
RenderObjects();
}
if (n==1)
{
glViewport (0, 0, hWindow/2, wWindow/2);
glScissor (0, 0, hWindow/2, wWindow/2);
glMatrixMode (GL_PROJECTION);
glLoadIdentity ();
gluPerspective( 100.0, wWindow/hWindow, 0.1f, 250.0 );
RenderObjects();
}
}
When I do this, there is only one viewport being created (in the bottom left). I’m not sure what’s wrong. Any insight would be awesome, cheers!