GLProgramming.com

home :: about :: development guides :: irc :: forums :: search :: paste :: links :: contribute :: code dump

-> Click here to learn how to get live help <-


New Paste :: Recent Pastes:: No Line Numbers


A Paste by godecho
1
 
void SetOrthoProjection()
{
    //glPushAttrib(GL_DEPTH_TEST);
    //glDisable(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 ResetPersProjection()
{
    glMatrixMode(GL_PROJECTION);
    glPopMatrix();                                    // Pop the stack
    glMatrixMode(GL_MODELVIEW);                        // Put us back in modelview mode                                            

    //glEnable(GL_DEPTH_TEST);    // Turn depth testing back on
    //glPopAttrib();
}