The customary way to set the viewport for a window in GLUT is to use a reshape callback:


void reshape( int width, int height )
{
glViewport(0, 0, width, height);
}

...