As discussed in our example viewports, we capture the dimensions of the device window when resizing occurs and use these dimensions when specifying the two viewports used in this example. Thus, we register with GLUT a reshape function that saves the width and height passed to it.

Also recall that since we have registered a reshape function, OpenGL no longer sets the viewport on reshape events. We are handling this in our display method.