scaling and offset to fill whole viewport?

How can I calculate the amount of offset and scaling needed for perspective rendering of my world so that it touches all viewport edges? I could manually translate and rotate all my vertices and then calculate the min and max, but is there some way I can use openGL functions instead?