One of the two things performed in our reshape function is saving the device dimensions in the variables deviceWindowWidth and deviceWindowHeight. We use the two values in our mouse motion function when computing the amount to change the angles of rotation (see the discussion on the motion function).

We also set here the viewport since we registered a reshape function. Recall that OpenGL sets the viewport to the default one, namely, the entire canvas UNLESS we register a reshape function and then we must handle it in our code.