I have been trying to get world coordinates of the cursor position for a program by:

  1. getting the top and left position of the client of the window
  2. getting the global position of the cursor (GetCursorPos())
  3. cursor x - client left and cursor y - client top
  4. zoom x and y = client width and height / 100 (the openGL world size in the program)
  5. divide cursor pos x and y by zoom x and y

I made it up myself so it may have major errors.
it doesn't work, but am I along the right lines or is there an obvious reason for it not working?

7 Years
Discussion Span
Last Post by MattyRobot

yes I will try that...
done, it works exactly the same, but with less code so thanks.
but the problem is the same, am I doing it right?

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.