GL_SCISSOR_TEST

Hi, I am trying to split the screen between two views. A 3D view for navigation, and a 2D one for indicators, gauges and such.
I use GL_SCISSOR_TEST to split the screen in half. The problem is that the 2D indicators disappear after the first redisplay, unless I don’t show the 3D environment.
When I comment the 3D methods, the indicators show up fine, but when both are working, only the 3D environment gets displayed in its half of the screen.

Is there anything I can do about that? Is there anything wrong with the code I’m using?

Any help would be much appreciated. Thanks!


glScissor(0,0,GetSystemMetrics(SM_CXFULLSCREEN), GetSystemMetrics(SM_CYFULLSCREEN)/2);
glEnable(GL_SCISSOR_TEST);
glDisable(GL_DEPTH_TEST);
glDisable(GL_ALPHA_TEST);
glDisable(GL_STENCIL_TEST);
glClear(GL_COLOR_BUFFER_BIT);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluOrtho2D(0.0, 840.0, 0.0, 380.0);

/* 2D methods */

glScissor(0, GetSystemMetrics(SM_CYFULLSCREEN)/2, GetSystemMetrics(SM_CXFULLSCREEN), GetSystemMetrics(SM_CYFULLSCREEN)/2+100);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(60.0,1.0,1,20000000);
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LEQUAL);
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

/*3D methods */

glDisable(GL_SCISSOR_TEST);
glFlush();
glutSwapBuffers();
glutTimerFunc(10,myTimer,1);

Don’t cross-post.

Duplicate thread collapse here.

Ok, how do I delete the topic?