glViewPort doent work twice

I want to draw a scene from 2 different points on view.

But when I do :

glViewPort(0,0,w/2,h);
display();
glViewPort(w/2,0,w/2,h);
display();
glutSwapBuffer();

it only draws in the SECOND ViewPort : (w/2,0,w/2,h)
And when I write
glViewPort(0,0,w/2,h/2);
display();
glViewPort(0,h/2,w/2,h/2);
display();
glviewport(w/2,0,w/2,h/2);
display();
glViewPort(w/2,h/2,w/2,h/2);
display();
glutSwapBuffers();

It also draws only un the LAST ViewPort : (w/2,h/2,w/2,h/2).

Can you help me? Thank you very much.

You probably call glClear in your display function. glClear will clear the entire client area, and not only the part specified by glViewport. What happens when you draw your second viewport is that you clear the entire client area, and the first viewport is erased (same for third and fourth viewport, any previsously drawing will be cleared). If you want to limit the area of glClear, you must use glScissor also.

Thank you!!! That was the solution!!! Great!