Sign in to follow this  

getting mouse coordinates

This topic is 4869 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

Hey , I need a function which will return the current mouse screen coordinates? , I'm using DevC++ , I just dont know what function to use , any help would be appreciated cheers Stealth

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
POINT is a struct that contains both x and y coordinates.
POINT mypoint;
mypoint.x = 10;
mypoint.y = 20;

I can't remember if windows returns absolute or relative coordinates, but they can be converted with some equally obscure win32api functions. Windows operates with both screen, absolute and relative coordinates if I remember correctly. It's a pain, but you only have to write the code once in your game.

Share this post


Link to post
Share on other sites
Just to clear this up...
GetCursorPos gives relative coords
ScreenToClient(HWND,POINT) converts relative coords to window coords and ClientToScreen(HWND,POINT) does the reverse.

-TOmcAT

Share this post


Link to post
Share on other sites

This topic is 4869 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this