basic question - glViewport & gluOrtho2D

hi

i’ve always wondered why glViewport takes coordinate arguments in the order (x1, y1, x2, y2), while gluOrtho2D is (x1, x2, y1, y2).

any particular reason?

glViewport takes (x, y, width, height) while gluOrtho2D takes (left, right, bottom, top). My guess is that this is because glViewport talks specifically about an on-screen window region while gluOrtho2D and the other projection matrix methods talk about volumes in 3D space (even though gluOrtho2D is a degenerate case).