Jump to content
  • Advertisement
Sign in to follow this  
123abcd1983

Screen resolution affected the value generated by getcursorpos. Any solution?

This topic is 4234 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Some problem happened, when i changed the screen resolution, the value generated by the getcursorpos will be different, how can i get the location base on the screen resolution. I want to point an object on the screen, so the x, and y value generated by getcursorpos is very important. Sorry i posted another duplicate post, because last post I forgot to write the title.

Share this post


Link to post
Share on other sites
Advertisement
Unless I'm much mistaken, GetCursorPos() is part of the core Windows API and nothing specific to DirectX. Moved to General Programming.

Quote:
Original post by 123abcd1983
Sorry i posted another duplicate post, because last post I forgot to write the title.
You should be able to delete your own threads provided there are no replies and you do it quickly, or you can go back in an edit the subject line rather than reposting. Either way, I've deleted your other thread for you.


Jack

Share this post


Link to post
Share on other sites
Have you considered using dimensionless screen coordinates? Simply dividing the x and y values you get from GetCursorPos by their respective screen resolution dimensions, you'll have coordinates in the range [0, 1] independent of the resolution.

Regards
Admiral

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!