PDA

View Full Version : GL_SCISSOR_TEST



A elalaily
12-24-2009, 05:38 AM
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);

Dark Photon
12-24-2009, 07:43 AM
Don't cross-post.

Duplicate thread collapse here (http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=269244&Searchpa ge=1&Main=52070&Words=Dark+Photon&Search=true#Post 269244).

A elalaily
12-24-2009, 08:17 AM
Ok, how do I delete the topic?