View Full Version : Convert windows mouse coordinates to opengl coordinates

12-04-2013, 01:48 PM
Currently I am trying to click and drag drawings around in my opengl window however I don't know how to convert to opengl coordinates. I'm making a windows application so I don't want to use external libraries such as glut so I'll learn how to do this in c++. I'm currently getting the mouse position GET_X_LPARAM(lparam), GET_Y_LPARAM(lparam).

Can anyone help?

12-05-2013, 05:44 PM
If you don't want to use libraries (not sure why glm is operating system independant) then you have to reverse this logic http://www.songho.ca/opengl/gl_transform.html