View Full Version : Pixel in opengl

01-14-2003, 11:43 PM
I wanted to know to the correspondence between the pixels of Windows and the values of opengl. Because when i made clic on the window i get de X coordinate of the window and the Y coordinate, but i have to know the coordinate in opengl, I used a 900*600 window and 2d opengl pixel format without perspective. thankx.

01-14-2003, 11:57 PM
You can use gluUnProject for that.
Note that Windows' coordinates use a top-left origin and OpenGL uses bottom-left.
Your mouse y-coordinate needs to be inverted.