Hi, I am trying to slpit the screen between two views. A 3D view for navigation, and a 2D one for indcators, gauges and such.
I use glViewport to split the screen in half. The problem is that the 2D indcators don’t get shown, unless I don’t show the 3D enviroment.
When I comment the 3D methods, the indcators show up fine, but when both are working, only the 3D eviroment 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!
glViewport (0, 0, GetSystemMetrics(SM_CXFULLSCREEN), GetSystemMetrics(SM_CYFULLSCREEN)/2); glClear(GL_COLOR_BUFFER_BIT); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluOrtho2D(0.0, 840.0, 0.0, 380.0); /* 2D methods */ glViewport (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 */ glFlush(); glutSwapBuffers(); glutTimerFunc(10,myTimer,1);