Our second viewport covers the right half of the device window. As done with the first, we set its the boundaries and dimensions and then call the function lineLoop that creates (defines) the geometry.

The left boundary of this viewport starts at the midpoint of the device window. Also, the width of the viewport is half of the width of the device window. Therefore, we set each of these values to 0.5*deviceWindowWidth and, again, use an explicit type cast to int. The bottom boundary and the height of this viewport is the same as for the first viewport.