next up previous
Next: display Up: Code Previous: Helper Functions

reshape

This function is used so, when the window is resized in openGL, the picture changes its dimensions as well to fill the same proportions of the window.
void myReshape(int w, int h) 	//****** Mr. Hyatt's reshape function
{
    glViewport(0, 0, w, h);
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    
    gluPerspective( 40.0, (GLfloat) w / (GLfloat) h , 0.1,  120.0);
    glMatrixMode(GL_MODELVIEW);

}



Michael Hull 2003-06-11