martinjy
05-20-2001, 06:50 AM
Hi,
is it possible to first draw objects in perspective mode, and then switch this view with gluOrtho2D and draw other objects, like controlbars etc..
in my RenderScene procedure, after drawing 3D, i would switch like this:
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
gluOrtho2D(0, viewWidth, viewHeight, 0);
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
glPushAttrib(GL_ENABLE_BIT);
glDisable(GL_LIGHTING);
glDisable(GL_DEPTH_TEST);
glEnable(GL_TEXTURE_2D);
glEnable(GL_SCISSOR_TEST);
// i write my drawing code here
glDisable(GL_TEXTURE_2D);
glPopAttrib();
glPopMatrix();
glMatrixMode(GL_PROJECTION);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
why doesn't this work?
anybody?
is it possible to first draw objects in perspective mode, and then switch this view with gluOrtho2D and draw other objects, like controlbars etc..
in my RenderScene procedure, after drawing 3D, i would switch like this:
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
gluOrtho2D(0, viewWidth, viewHeight, 0);
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
glPushAttrib(GL_ENABLE_BIT);
glDisable(GL_LIGHTING);
glDisable(GL_DEPTH_TEST);
glEnable(GL_TEXTURE_2D);
glEnable(GL_SCISSOR_TEST);
// i write my drawing code here
glDisable(GL_TEXTURE_2D);
glPopAttrib();
glPopMatrix();
glMatrixMode(GL_PROJECTION);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
why doesn't this work?
anybody?