void ScreenMgr::Screen::SetOrthoProj() const
{
StateMgr::Inst()->StateDisable(GL_DEPTH_TEST); // Turn depth testing off
glMatrixMode(GL_PROJECTION); // Switch to projection mode
glPushMatrix(); // Save previous matrix which contains the settings for the perspective projection
glLoadIdentity();
glOrtho(0, width, 0, height, -1, 1);
glMatrixMode(GL_MODELVIEW);
}
void ScreenMgr::Screen::ResetPersProj() const
{
glMatrixMode(GL_PROJECTION);
glPopMatrix(); // Pop the stack
glMatrixMode(GL_MODELVIEW); // Put us back in modelview mode
StateMgr::Inst()->StateEnable(GL_DEPTH_TEST); // Turn depth testing back on
}
/* when i want to do something with pixel coordinates, say render text, i make a call to the first function. I do all of my text drawing, then make a call to this second function. i was wondering if this constitutes as projection mode abuse or not. */