The getviewport subroutine returns the current viewport. Its parameters (left, right, bottom, top) are the addresses of four memory locations. These are assigned the left, right, bottom, and top coordinates of the current viewport. The syntax is as follows:
void getviewport(Screencoord *left, Screencoord *right, Screencoord *bottom, Screencoord *top)