about glViewport

what difference between glViewport and glOrtho2D?

They do different things. glViewport sets the size of the area of your window that OpenGL uses, and gluOrtho2D (and glOrtho and gluPerspective and glFrustrum) changes your projection matrix.

Viewport area of the screen in which to render the image to. example would be 640 x 480 as the screen area to render to, also could be only a portion of the screen.

Ortho, Ortho2D, Perspective indicates the area in which to render from in the 3D world.

Originally posted by tigeryhong:
what difference between glViewport and glOrtho2D?